1.3发布
18
Model.php
|
@ -74,8 +74,8 @@ class Model{
|
|||
$total_page = ceil($total / $pageSize);
|
||||
$page = min(intval(max($page, 1)), $total);
|
||||
$min=($page-1)*$pageSize+1;
|
||||
$max=$page*$pageSize;
|
||||
$max=$max>$total?$total:$max;
|
||||
$max=$page*$pageSize;
|
||||
$max=$max>$total?$total:$max;
|
||||
$this->page = array(
|
||||
'total_count' => $total,
|
||||
'page_size' => $pageSize,
|
||||
|
@ -160,10 +160,12 @@ class Model{
|
|||
|
||||
function err($msg){
|
||||
if (ob_get_contents()) ob_end_clean();
|
||||
function _err_highlight_code($code){if(preg_match('/\<\?(php)?[^[:graph:]]/i', $code)){return highlight_string($code, TRUE);}else{return preg_replace('/(<\?php )+/i', "", highlight_string("<?php ".$code, TRUE));}}
|
||||
function _err_getsource($file, $line){if(!(file_exists($file) && is_file($file))) {return '';}$data = file($file);$count = count($data) - 1;$start = $line - 5;if ($start < 1) {$start = 1;}$end = $line + 5;if ($end > $count) {$end = $count + 1;}$returns = array();for($i = $start; $i <= $end; $i++) {if($i == $line){$returns[] = "<div id='current'>".$i.". "._err_highlight_code($data[$i - 1], TRUE)."</div>";}else{$returns[] = $i.". "._err_highlight_code($data[$i - 1], TRUE);}}return $returns;
|
||||
function _err_highlight_code($code){if(preg_match('/\<\?(php)?[^[:graph:]]/i', $code)){return highlight_string($code, TRUE);}else{return preg_replace('/(<\?php )+/i', "", highlight_string("<?php ".$code, TRUE));}}
|
||||
function _err_getsource($file, $line){if(!(file_exists($file) && is_file($file))) {return '';}$data = file($file);$count = count($data) - 1;$start = $line - 5;if ($start < 1) {$start = 1;}$end = $line + 5;if ($end > $count) {$end = $count + 1;}$returns = array();for($i = $start; $i <= $end; $i++) {if($i == $line){$returns[] = "<div id='current'>".$i.". "._err_highlight_code($data[$i - 1], TRUE)."</div>";}else{$returns[] = $i.". "._err_highlight_code($data[$i - 1], TRUE);}}return $returns;
|
||||
}?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="robots" content="noindex, nofollow, noarchive" /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title><?php echo $msg;?></title><style>body{padding:0;margin:0;word-wrap:break-word;word-break:break-all;font-family:Courier,Arial,sans-serif;background:#EBF8FF;color:#5E5E5E;}div,h2,p,span{margin:0; padding:0;}ul{margin:0; padding:0; list-style-type:none;font-size:0;line-height:0;}#body{width:918px;margin:0 auto;}#main{width:918px;margin:13px auto 0 auto;padding:0 0 35px 0;}#contents{width:918px;float:left;margin:13px auto 0 auto;background:#FFF;padding:8px 0 0 9px;}#contents h2{display:block;background:#CFF0F3;font:bold 20px;padding:12px 0 12px 30px;margin:0 10px 22px 1px;}#contents ul{padding:0 0 0 18px;font-size:0;line-height:0;}#contents ul li{display:block;padding:0;color:#8F8F8F;background-color:inherit;font:normal 14px Arial, Helvetica, sans-serif;margin:0;}#contents ul li span{display:block;color:#408BAA;background-color:inherit;font:bold 14px Arial, Helvetica, sans-serif;padding:0 0 10px 0;margin:0;}#oneborder{width:800px;font:normal 14px Arial, Helvetica, sans-serif;border:#EBF3F5 solid 4px;margin:0 30px 20px 30px;padding:10px 20px;line-height:23px;}#oneborder span{padding:0;margin:0;}#oneborder #current{background:#CFF0F3;}</style></head><body><div id="main"><div id="contents"><h2><?php echo $msg?></h2><?php foreach($traces as $trace){if(is_array($trace)&&!empty($trace["file"])){$souceline = _err_getsource($trace["file"], $trace["line"]);if($souceline){?><ul><li><span><?php echo $trace["file"];?> on line <?php echo $trace["line"];?> </span></li></ul><div id="oneborder"><?php foreach($souceline as $singleline)echo $singleline;?></div><?php }}}?></div></div><div style="clear:both;padding-bottom:50px;" /></body></html><?php }
|
||||
//遇到错误 不结束掉页面
|
||||
//exit;
|
||||
?>
|
||||
<?php if (!$GLOBALS['config']['DEBUG']): ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="robots" content="noindex, nofollow, noarchive" /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title><?php echo $msg;?></title><style>body{padding:0;margin:0;word-wrap:break-word;word-break:break-all;font-family:Courier,Arial,sans-serif;background:#EBF8FF;color:#5E5E5E;}div,h2,p,span{margin:0; padding:0;}ul{margin:0; padding:0; list-style-type:none;font-size:0;line-height:0;}#body{width:918px;margin:0 auto;}#main{width:918px;margin:13px auto 0 auto;padding:0 0 35px 0;}#contents{width:918px;float:left;margin:13px auto 0 auto;background:#FFF;padding:8px 0 0 9px;}#contents h2{display:block;background:#CFF0F3;font:bold 20px;padding:12px 0 12px 30px;margin:0 10px 22px 1px;}#contents ul{padding:0 0 0 18px;font-size:0;line-height:0;}#contents ul li{display:block;padding:0;color:#8F8F8F;background-color:inherit;font:normal 14px Arial, Helvetica, sans-serif;margin:0;}#contents ul li span{display:block;color:#408BAA;background-color:inherit;font:bold 14px Arial, Helvetica, sans-serif;padding:0 0 10px 0;margin:0;}#oneborder{width:800px;font:normal 14px Arial, Helvetica, sans-serif;border:#EBF3F5 solid 4px;margin:0 30px 20px 30px;padding:10px 20px;line-height:23px;}#oneborder span{padding:0;margin:0;}#oneborder #current{background:#CFF0F3;}</style></head><body><div id="main"><div id="contents"><h2><?php echo $msg?></h2><?php foreach($traces as $trace){if(is_array($trace)&&!empty($trace["file"])){$souceline = _err_getsource($trace["file"], $trace["line"]);if($souceline){?><ul><li><span><?php echo $trace["file"];?> on line <?php echo $trace["line"];?> </span></li></ul><div id="oneborder"><?php foreach($souceline as $singleline)echo $singleline;?></div><?php }}}?></div></div><div style="clear:both;padding-bottom:50px;" /></body></html>
|
||||
<?php else : exit();?>
|
||||
<?php endif ?>
|
||||
<?php }?>
|
||||
|
||||
|
|
71
README.md
|
@ -17,10 +17,11 @@
|
|||
|
||||
#### 安装教程
|
||||
|
||||
1. 安装请直接上传项目,解压到根目录,之后访问域名即可,路径为/install
|
||||
2. 初始账号:admin
|
||||
3. 初始密码:admin000
|
||||
4. 请搭建完成后尽快修改密码
|
||||
1. 安装请直接上传项目,解压到根目录,之后访问域名即可安装
|
||||
2. 安装时请确认是最新版本
|
||||
3. 请确认函数都支持
|
||||
4. 数据库信息填写完整
|
||||
5. 填写域名等账号信息
|
||||
|
||||
#### 使用说明
|
||||
|
||||
|
@ -30,7 +31,7 @@
|
|||
|
||||
#### 项目特色
|
||||
|
||||
前台支持两主题的切换,ajax点赞,浏览次数统计和站内站外分开跳转的功能
|
||||
前台支持三套主题的切换,ajax点赞,浏览次数统计和站内站外分开跳转的功能
|
||||
内置时间轴功能,可以记录你的网站发展历程和一些重要的消息
|
||||
关于页面支持留言,内置smtp发信可以轻松完成用户交流
|
||||
后台使用Unicorn Admin开源项目进行对接搭建完成
|
||||
|
@ -49,42 +50,36 @@
|
|||
答:项目本身支持站内站外跳转,添加新的工具箱,你只需要在网站Tools目录下创建一个文件夹,在文件夹内部就是你的工具箱,只需要在头部插入
|
||||
|
||||
<?php
|
||||
$id="xx"; //后台生成的工具id
|
||||
include "../../header.php";
|
||||
?>
|
||||
这是你的主体
|
||||
/*
|
||||
Title:你的工具标题
|
||||
Subtitle:工具描述
|
||||
Plugin Name:工具名
|
||||
Description:工具关键词
|
||||
Author:作者
|
||||
Author Email:作者邮箱
|
||||
Author URL:作者主页
|
||||
Version:工具版本
|
||||
*/
|
||||
$CONF = require('../../function.config.php');
|
||||
$self = $_SERVER['PHP_SELF'];
|
||||
preg_match_all('/'.$CONF['config']['TOOLS_T'].'\/(.*)\//', $self, $name);
|
||||
$id = $name[1][0];
|
||||
include '../../header.php';?>
|
||||
工具主体内容
|
||||
<?php include '../../footer.php';?>
|
||||
|
||||
2. 问:伪静态规则有没有特别的要求?
|
||||
|
||||
答:版本1.2需要用到伪静态->
|
||||
Nginx规则:
|
||||
答:1.3版本无需伪静态
|
||||
|
||||
if (!-f $request_filename){set $rule_0 1$rule_0;}
|
||||
if (!-d $request_filename){set $rule_0 2$rule_0;}
|
||||
if ($request_filename !~ "-l"){set $rule_0 3$rule_0;}
|
||||
if ($rule_0 = "321"){rewrite ^/([a-zA-Z0-9_-]+)$ /Tools/$1 last;}
|
||||
|
||||
Apache规则:
|
||||
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine on
|
||||
RewriteOptions MaxRedirects=1
|
||||
RewriteBase /
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-l
|
||||
RewriteRule ^([a-zA-Z0-9_-]+)$ Tools/$1 [L]
|
||||
</IfModule>
|
||||
|
||||
3. 问:后台路径和密码是什么?
|
||||
|
||||
答:后台路径为/tools_admin 账号:admin 密码:admin000
|
||||
请搭建完成后尽快修改密码
|
||||
答:后台路径为/admin 可自行修改后台路径。
|
||||
|
||||
4. 问:如何安装?
|
||||
|
||||
答:安装请直接上传项目,解压到根目录,之后访问域名即可,路径为/install
|
||||
答:安装请直接上传项目,解压到根目录,之后访问域名即可安装
|
||||
|
||||
5. 问:php版本是否有限制?
|
||||
|
||||
|
@ -92,11 +87,11 @@
|
|||
|
||||
6. 问:我需要注意些什么?
|
||||
|
||||
答:本身为开源项目,也是第一次做开源项目,所以本程序未加密,但是建议大家不改,尊重作者!
|
||||
答:本项目为开源项目,禁止修改版权,禁止商业出售,一经发现,杨小杰API接口服务全部拉黑(部分工具)。
|
||||
|
||||
7. 问:谷歌浏览器,火狐浏览器下载附件报毒?
|
||||
7. 常识问题
|
||||
|
||||
答:开源项目,代码基本都是我亲自审查的,所以我可以保证是没有问题的,哈勃分析也显示未发现风险,至于为毛它俩要爆我毒,我就不清楚了
|
||||
答:因为项目初期被刀网等一些资源网转载时存在需要bug,所以请不要拿着1.3版本之前的问题来找小杰了,自己下载最新版安装即可,谢谢。
|
||||
|
||||
8. 问:无限循环安装是什么鬼?
|
||||
|
||||
|
@ -104,7 +99,12 @@
|
|||
|
||||
9. 安装之后布局全乱,css加载失败是怎么回事?
|
||||
|
||||
答:安装最新版请删除原有数据库,也有可能是安装是目录填写错误导致。
|
||||
答:这个是老生常谈的问题了
|
||||
1.有可能你的地址填写错误。
|
||||
2.CC、TOP域名无法使用BootCDN服务。
|
||||
如果是第一个,请到后台修改地址
|
||||
如果是第二个,请下载样式文件到本地,然后去源码替换成本地文件
|
||||
|
||||
|
||||
更多问题有待发掘……
|
||||
|
||||
|
@ -119,4 +119,5 @@
|
|||
7. 2018年5月12日 新增工具排行切换,优化前台框架,后台设置下拉类选项,公告小窗编写,重写后台登录验证,项目版本1.1正式发布
|
||||
8. 2018年5月13日 版本:1.1.1 新增QQ跳转,新增6中排行规则,自定义工具作者
|
||||
9. 2018年6月12日 版本:1.2 新增在线升级,logo上传,整理小工具到二级目录,代码优化,增加共计13个小工具(重量计量计算换算,fuckjs编码,正则表达式在线测试,JSON验证整理,在线进制转换,中国家庭称谓计算器,文本转ASCII,在线文本对比,在线长度换算器,PV刷新工具,线条字生成,骰子游戏,在线网址链接批量生成器)
|
||||
10. 2018年6月15日 版本1.2.1 取消跳转,取消伪静态,修复留言用户名编码,修复后台登录失败提醒,修复二级目录安装,修复相关工具地址
|
||||
10. 2018年6月15日 版本1.2.1 取消跳转,取消伪静态,修复留言用户名编码,修复后台登录失败提醒,修复二级目录安装,修复相关工具地址
|
||||
11. 2018年7月7日 版本1.3 翻修更新大部分工具样式及功能、前端增加一套卡片主题(mdui)、后台登录增加极验验证码、后台一键上传、一键安装、在线应用中心、修复删除工具(删除工具文件)、后台个性主题管理、增加全局参数防护、取消后台统计代码设置(因为全局参数防护导致的)、修复相关工具、安装时函数检测、安装地址自动加http://、安装时检测项目最新版、优化整理,归纳所有类库及代码
|
||||
|
|
|
@ -1,201 +0,0 @@
|
|||
;(function (global, undefined) {
|
||||
/*jshint sub:true, evil:true */
|
||||
"use strict";
|
||||
|
||||
var numbers,
|
||||
_object_Object,
|
||||
_NaN,
|
||||
_true,
|
||||
_false,
|
||||
_undefined,
|
||||
_Infinity,
|
||||
_1e100,
|
||||
characters,
|
||||
functionConstructor,
|
||||
escape,
|
||||
unescape,
|
||||
locationString,
|
||||
API;
|
||||
|
||||
numbers = [
|
||||
"+[]",
|
||||
"+!![]",
|
||||
"!+[]+!![]",
|
||||
"!+[]+!![]+!![]",
|
||||
"!+[]+!![]+!![]+!![]",
|
||||
"!+[]+!![]+!![]+!![]+!![]",
|
||||
"!+[]+!![]+!![]+!![]+!![]+!![]",
|
||||
"!+[]+!![]+!![]+!![]+!![]+!![]+!![]",
|
||||
"!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]",
|
||||
"!+[]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]"
|
||||
];
|
||||
|
||||
characters = {
|
||||
"0" : "(" + numbers[0] + "+[])",
|
||||
"1" : "(" + numbers[1] + "+[])",
|
||||
"2" : "(" + numbers[2] + "+[])",
|
||||
"3" : "(" + numbers[3] + "+[])",
|
||||
"4" : "(" + numbers[4] + "+[])",
|
||||
"5" : "(" + numbers[5] + "+[])",
|
||||
"6" : "(" + numbers[6] + "+[])",
|
||||
"7" : "(" + numbers[7] + "+[])",
|
||||
"8" : "(" + numbers[8] + "+[])",
|
||||
"9" : "(" + numbers[9] + "+[])"
|
||||
};
|
||||
|
||||
_object_Object = "[]+{}";
|
||||
_NaN = "+{}+[]";
|
||||
_true = "!![]+[]";
|
||||
_false = "![]+[]";
|
||||
_undefined = "[][[]]+[]";
|
||||
|
||||
characters[" "] = "(" + _object_Object + ")[" + numbers[7] + "]";
|
||||
characters["["] = "(" + _object_Object + ")[" + numbers[0] + "]";
|
||||
characters["]"] = "(" + _object_Object + ")[" + characters[1] + "+" +
|
||||
characters[4] + "]";
|
||||
characters["a"] = "(" + _NaN + ")[" + numbers[1] + "]";
|
||||
characters["b"] = "(" + _object_Object + ")[" + numbers[2] + "]";
|
||||
characters["c"] = "(" + _object_Object + ")[" + numbers[5] + "]";
|
||||
characters["d"] = "(" + _undefined + ")[" + numbers[2] + "]";
|
||||
characters["e"] = "(" + _undefined + ")[" + numbers[3] + "]";
|
||||
characters["f"] = "(" + _undefined + ")[" + numbers[4] + "]";
|
||||
characters["i"] = "(" + _undefined + ")[" + numbers[5] + "]";
|
||||
characters["j"] = "(" + _object_Object + ")[" + numbers[3] + "]";
|
||||
characters["l"] = "(" + _false + ")[" + numbers[2] + "]";
|
||||
characters["n"] = "(" + _undefined + ")[" + numbers[1] + "]";
|
||||
characters["o"] = "(" + _object_Object + ")[" + numbers[1] + "]";
|
||||
characters["r"] = "(" + _true + ")[" + numbers[1] + "]";
|
||||
characters["s"] = "(" + _false + ")[" + numbers[3] + "]";
|
||||
characters["t"] = "(" + _true + ")[" + numbers[0] + "]";
|
||||
characters["u"] = "(" + _undefined + ")[" + numbers[0] +"]";
|
||||
characters["N"] = "(" + _NaN + ")[" + numbers[0] + "]";
|
||||
characters["O"] = "(" + _object_Object + ")[" + numbers[8] + "]";
|
||||
|
||||
_Infinity = "+(" + numbers[1] + "+" + characters["e"] + "+" +
|
||||
characters[1] + "+" + characters[0] + "+" + characters[0] + "+" +
|
||||
characters[0] + ")+[]";
|
||||
|
||||
characters["y"] = "(" + _Infinity + ")[" + numbers[7] + "]";
|
||||
characters["I"] = "(" + _Infinity + ")[" + numbers[0] + "]";
|
||||
|
||||
_1e100 = "+(" + numbers[1] + "+" + characters["e"] + "+" +
|
||||
characters[1] + "+" + characters[0] + "+" + characters[0] + ")+[]";
|
||||
|
||||
characters["+"] = "(" + _1e100 + ")[" + numbers[2] + "]";
|
||||
|
||||
functionConstructor = "[][" + hieroglyphyString("sort") + "][" +
|
||||
hieroglyphyString("constructor") + "]";
|
||||
|
||||
//Below characters need target http(s) pages
|
||||
locationString = "[]+" + hieroglyphyScript("return location");
|
||||
characters["h"] = "(" + locationString + ")" + "[" + numbers[0] + "]";
|
||||
characters["p"] = "(" + locationString + ")" + "[" + numbers[3] + "]";
|
||||
characters["/"] = "(" + locationString + ")" + "[" + numbers[6] + "]";
|
||||
|
||||
unescape = hieroglyphyScript("return unescape");
|
||||
escape = hieroglyphyScript("return escape");
|
||||
|
||||
characters["%"] = escape + "(" + hieroglyphyString("[") + ")[" +
|
||||
numbers[0] + "]";
|
||||
|
||||
function getHexaString (number, digits) {
|
||||
var string = number.toString(16);
|
||||
|
||||
while (string.length < digits) {
|
||||
string = "0" + string;
|
||||
}
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
function getUnescapeSequence (charCode) {
|
||||
return unescape + "(" +
|
||||
hieroglyphyString("%" + getHexaString(charCode, 2)) + ")";
|
||||
}
|
||||
|
||||
function getHexaSequence (charCode) {
|
||||
return hieroglyphyString("\\x" + getHexaString(charCode, 2));
|
||||
}
|
||||
|
||||
function getUnicodeSequence (charCode) {
|
||||
return hieroglyphyString("\\u" + getHexaString(charCode, 4));
|
||||
}
|
||||
|
||||
function hieroglyphyCharacter (char) {
|
||||
var charCode = char.charCodeAt(0),
|
||||
unescapeSequence,
|
||||
hexaSequence,
|
||||
unicodeSequence,
|
||||
shortestSequence;
|
||||
|
||||
if (characters[char] !== undefined) {
|
||||
return characters[char];
|
||||
}
|
||||
|
||||
if ((char === "\\") || (char == "x")) {
|
||||
//These chars must be handled appart becuase the others need them
|
||||
characters[char] = getUnescapeSequence(charCode);
|
||||
return characters[char];
|
||||
}
|
||||
|
||||
shortestSequence = getUnicodeSequence(charCode);
|
||||
|
||||
//ASCII characters can be obtained with hexa and unscape sequences
|
||||
if (charCode < 128) {
|
||||
unescapeSequence = getUnescapeSequence(charCode);
|
||||
if (shortestSequence.length > unescapeSequence.length) {
|
||||
shortestSequence = unescapeSequence;
|
||||
}
|
||||
|
||||
hexaSequence = getHexaSequence(charCode);
|
||||
if (shortestSequence.length > hexaSequence.length) {
|
||||
shortestSequence = hexaSequence;
|
||||
}
|
||||
}
|
||||
|
||||
characters[char] = shortestSequence;
|
||||
return shortestSequence;
|
||||
}
|
||||
|
||||
function hieroglyphyString (str) {
|
||||
var i,
|
||||
hieroglyphiedStr = "";
|
||||
|
||||
for (i = 0; i < str.length; i += 1) {
|
||||
|
||||
hieroglyphiedStr += (i > 0) ? "+" : "";
|
||||
hieroglyphiedStr += hieroglyphyCharacter(str[i]);
|
||||
}
|
||||
|
||||
return hieroglyphiedStr;
|
||||
}
|
||||
|
||||
function hieroglyphyNumber (n) {
|
||||
n = +n;
|
||||
|
||||
if (n <= 9) {
|
||||
return numbers[n];
|
||||
}
|
||||
|
||||
return "+(" + hieroglyphyString(n.toString(10)) + ")";
|
||||
}
|
||||
|
||||
function hieroglyphyScript (src) {
|
||||
return functionConstructor + "(" + hieroglyphyString(src) + ")()";
|
||||
}
|
||||
|
||||
API = {
|
||||
hieroglyphyString: hieroglyphyString,
|
||||
hieroglyphyNumber: hieroglyphyNumber,
|
||||
hieroglyphyScript: hieroglyphyScript
|
||||
};
|
||||
|
||||
if (global.define && global.define.amd) {
|
||||
global.define([], API);
|
||||
} else if (typeof exports !== "undefined") {
|
||||
module.exports = API;
|
||||
} else {
|
||||
global.hieroglyphy = API;
|
||||
}
|
||||
|
||||
})(this);
|
|
@ -1,160 +0,0 @@
|
|||
<?php
|
||||
$id="44";
|
||||
include '../../header.php';
|
||||
?>
|
||||
<div class="container">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">js编码</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<form class="ns">
|
||||
<p><b><span class="form_label" style="width: 300px;">贴入要加密混乱的Javascript代码</span></b></p>
|
||||
<p><textarea id="js_input" value="" class="form-control" rows="5">document.write('YoungxjTools tools.yum6.cn');</textarea></p>
|
||||
<p>
|
||||
<input type="button" class="btn btn-primary" onclick="javascript:on_click(1);" value="转码1">
|
||||
<input type="button" class="btn btn-success" onclick="javascript:on_click(2);" value="转码2">
|
||||
<input type="button" class="btn btn-info" onclick="javascript:on_click(3);" value="字符串转码">
|
||||
<input type="button" class="btn btn-warning" onclick="javascript:on_click(4);" value="JS转码">
|
||||
<input type="button" class="btn btn-default" onclick="javascript:on_click(5);" value="数字转码">
|
||||
</p>
|
||||
<p>
|
||||
<textarea id="js_output" value="" class="form-control" rows="7"></textarea>
|
||||
</p>
|
||||
<div ><span id="stats" class="green" style="float:right;"> </span></div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="hieroglyphy.js"></script>
|
||||
<script src="jsfuck.js"></script>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">工具简介</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<li>6个字符[]()!+进行的转码加密</li>
|
||||
<li>建议只转码加密关键信息,代码过长转码加密时间会很长,甚至卡死。</li>
|
||||
<li style="color:red;">转码1 = 不直接执行</li>
|
||||
<li style="color:red;">转码2 = 直接执行</li>
|
||||
<li>工具可以把你的Javascript代码转化成只有6 个字符 []()!+ 的代码,并且完全可以正常执行。</li>
|
||||
<li>转换之后的Javascript代码非常难读,可以作为一些简单的保密措施,但是一般会增加文件大小,不建议采用。</li>
|
||||
<li>如果用作加密工具,请注意备份未加密的源代码。</li>
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Js代码</th>
|
||||
<th>转码</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>false</code>
|
||||
</th>
|
||||
<td>![]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>true</code>
|
||||
</th>
|
||||
<td>!![]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>undefined</code>
|
||||
</th>
|
||||
<td>[][[]]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>NaN</code>
|
||||
</th>
|
||||
<td>+[![]]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>0</code>
|
||||
</th>
|
||||
<td>+[]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>1</code>
|
||||
</th>
|
||||
<td>+!+[]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>2</code>
|
||||
</th>
|
||||
<td>!+[]+!+[]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>10</code>
|
||||
</th>
|
||||
<td>[+!+[]]+[+[]]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>Array</code>
|
||||
</th>
|
||||
<td>[]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>Number</code>
|
||||
</th>
|
||||
<td>+[]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>String</code>
|
||||
</th>
|
||||
<td>[]+[]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<code>Boolean</code>
|
||||
</th>
|
||||
<td>![]</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function on_click(t) {
|
||||
if (t == 1) {
|
||||
var output = JSFuck.encode($("#js_input").val(), 0);
|
||||
$("#js_output").val(output);
|
||||
$("#stats").html(output.length + " 字符");
|
||||
}
|
||||
else if(t == 2) {
|
||||
var output = JSFuck.encode($("#js_input").val(), 1);
|
||||
$("#js_output").val(output);
|
||||
$("#stats").html(output.length + " 字符");
|
||||
}
|
||||
else if(t == 3) {
|
||||
var output = hieroglyphy.hieroglyphyString($("#js_input").val());
|
||||
$("#js_output").val(output);
|
||||
$("#stats").html(output.length + " 字符");
|
||||
}
|
||||
else if(t == 4) {
|
||||
var output = hieroglyphy.hieroglyphyScript($("#js_input").val());
|
||||
$("#js_output").val(output);
|
||||
$("#stats").html(output.length + " 字符");
|
||||
}
|
||||
else if(t == 5) {
|
||||
var output = hieroglyphy.hieroglyphyNumber(+($("#js_input").val()));
|
||||
$("#js_output").val(output);
|
||||
$("#stats").html(output.length + " 字符");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php include '../../footer.php';?>
|
|
@ -1,315 +0,0 @@
|
|||
/*! JSFuck 0.4.0 - http://jsfuck.com */
|
||||
|
||||
(function(self){
|
||||
|
||||
var USE_CHAR_CODE = "USE_CHAR_CODE";
|
||||
|
||||
var MIN = 32, MAX = 126;
|
||||
|
||||
var SIMPLE = {
|
||||
'false': '![]',
|
||||
'true': '!![]',
|
||||
'undefined': '[][[]]',
|
||||
'NaN': '+[![]]',
|
||||
'Infinity': '+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])' // +"1e1000"
|
||||
};
|
||||
|
||||
var CONSTRUCTORS = {
|
||||
'Array': '[]',
|
||||
'Number': '(+[])',
|
||||
'String': '([]+[])',
|
||||
'Boolean': '(![])',
|
||||
'Function': '[]["filter"]',
|
||||
'RegExp': 'Function("return/0/")()'
|
||||
};
|
||||
|
||||
var MAPPING = {
|
||||
'a': '(false+"")[1]',
|
||||
'b': '(+(11))["toString"](20)',
|
||||
'c': '([]["filter"]+"")[3]',
|
||||
'd': '(undefined+"")[2]',
|
||||
'e': '(true+"")[3]',
|
||||
'f': '(false+"")[0]',
|
||||
'g': '(+false+[false]+String)[20]',
|
||||
'h': '(+(101))["toString"](21)[1]',
|
||||
'i': '([false]+undefined)[10]',
|
||||
'j': '(+(40))["toString"](21)[1]',
|
||||
'k': '(+(20))["toString"](21)',
|
||||
'l': '(false+"")[2]',
|
||||
'm': '(Number+"")[11]',
|
||||
'n': '(undefined+"")[1]',
|
||||
'o': '(true+[]["filter"])[10]',
|
||||
'p': '(+(211))["toString"](31)[1]',
|
||||
'q': '(+(212))["toString"](31)[1]',
|
||||
'r': '(true+"")[1]',
|
||||
's': '(false+"")[3]',
|
||||
't': '(true+"")[0]',
|
||||
'u': '(undefined+"")[0]',
|
||||
'v': '(+(31))["toString"](32)',
|
||||
'w': '(+(32))["toString"](33)',
|
||||
'x': '(+(101))["toString"](34)[1]',
|
||||
'y': '(NaN+[Infinity])[10]',
|
||||
'z': '(+(35))["toString"](36)',
|
||||
|
||||
'A': '(+false+Array)[10]',
|
||||
'B': '(+false+Boolean)[10]',
|
||||
'C': 'Function("return escape")()("<")[2]',
|
||||
'D': 'Function("return escape")()("=")[2]',
|
||||
'E': '(RegExp+"")[12]',
|
||||
'F': '(+false+Function)[10]',
|
||||
'G': '(false+Function("return Date")()())[30]',
|
||||
'H': USE_CHAR_CODE,
|
||||
'I': '(Infinity+"")[0]',
|
||||
//'J': USE_CHAR_CODE,
|
||||
'K': USE_CHAR_CODE,
|
||||
'L': USE_CHAR_CODE,
|
||||
'M': '(true+Function("return Date")()())[30]',
|
||||
'N': '(NaN+"")[0]',
|
||||
//'O': USE_CHAR_CODE,
|
||||
'P': USE_CHAR_CODE,
|
||||
'Q': USE_CHAR_CODE,
|
||||
'R': '(+false+RegExp)[10]',
|
||||
'S': '(+false+String)[10]',
|
||||
'T': '(NaN+Function("return Date")()())[30]',
|
||||
'U': USE_CHAR_CODE,
|
||||
'V': USE_CHAR_CODE,
|
||||
'W': USE_CHAR_CODE,
|
||||
'X': USE_CHAR_CODE,
|
||||
'Y': USE_CHAR_CODE,
|
||||
'Z': USE_CHAR_CODE,
|
||||
|
||||
' ': '(NaN+[]["filter"])[11]',
|
||||
'!': USE_CHAR_CODE,
|
||||
'"': '("")["fontcolor"]()[12]',
|
||||
'#': USE_CHAR_CODE,
|
||||
'$': USE_CHAR_CODE,
|
||||
'%': 'Function("return escape")()("<")[0]',
|
||||
'&': USE_CHAR_CODE,
|
||||
'\'': USE_CHAR_CODE,
|
||||
'(': '(false+[]["filter"])[20]',
|
||||
')': '(true+[]["filter"])[20]',
|
||||
'*': USE_CHAR_CODE,
|
||||
'+': '(+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]])+[])[2]',
|
||||
',': '[[]]["concat"]([[]])+""',
|
||||
'-': '(+(.+[0000000001])+"")[2]',
|
||||
'.': '(+(+!+[]+[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+[!+[]+!+[]]+[+[]])+[])[+!+[]]',
|
||||
'/': '(false+[+false])["italics"]()[10]',
|
||||
':': '(RegExp()+"")[3]',
|
||||
';': USE_CHAR_CODE,
|
||||
'<': '("")["italics"]()[0]',
|
||||
'=': '("")["fontcolor"]()[11]',
|
||||
'>': '("")["italics"]()[2]',
|
||||
'?': '(RegExp()+"")[2]',
|
||||
'@': USE_CHAR_CODE,
|
||||
'[': '(GLOBAL+"")[0]',
|
||||
'\\': USE_CHAR_CODE,
|
||||
']': USE_CHAR_CODE,
|
||||
'^': USE_CHAR_CODE,
|
||||
'_': USE_CHAR_CODE,
|
||||
'`': USE_CHAR_CODE,
|
||||
'{': '(NaN+[]["filter"])[21]',
|
||||
'|': USE_CHAR_CODE,
|
||||
'}': USE_CHAR_CODE,
|
||||
'~': USE_CHAR_CODE
|
||||
};
|
||||
|
||||
var GLOBAL = 'Function("return this")()';
|
||||
|
||||
function fillMissingChars(){
|
||||
for (var key in MAPPING){
|
||||
if (MAPPING[key] === USE_CHAR_CODE){
|
||||
MAPPING[key] = 'Function("return unescape")()("%"'+ key.charCodeAt(0).toString(16).replace(/(\d+)/g, "+($1)+\"") + '")';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function fillMissingDigits(){
|
||||
var output, number, i;
|
||||
|
||||
for (number = 0; number < 10; number++){
|
||||
|
||||
output = "+[]";
|
||||
|
||||
if (number > 0){ output = "+!" + output; }
|
||||
for (i = 1; i < number; i++){ output = "+!+[]" + output; }
|
||||
if (number > 1){ output = output.substr(1); }
|
||||
|
||||
MAPPING[number] = "[" + output + "]";
|
||||
}
|
||||
}
|
||||
|
||||
function replaceMap(){
|
||||
var character = "", value, original, i, key;
|
||||
|
||||
function replace(pattern, replacement){
|
||||
value = value.replace(
|
||||
new RegExp(pattern, "gi"),
|
||||
replacement
|
||||
);
|
||||
}
|
||||
|
||||
function digitReplacer(_,x) { return MAPPING[x]; }
|
||||
|
||||
function numberReplacer(_,y) {
|
||||
var values = y.split("");
|
||||
var head = +(values.shift());
|
||||
var output = "+[]";
|
||||
|
||||
if (head > 0){ output = "+!" + output; }
|
||||
for (i = 1; i < head; i++){ output = "+!+[]" + output; }
|
||||
if (head > 1){ output = output.substr(1); }
|
||||
|
||||
return [output].concat(values).join("+").replace(/(\d)/g, digitReplacer);
|
||||
}
|
||||
|
||||
for (i = MIN; i <= MAX; i++){
|
||||
character = String.fromCharCode(i);
|
||||
value = MAPPING[character];
|
||||
if(!value) {continue;}
|
||||
original = value;
|
||||
|
||||
for (key in CONSTRUCTORS){
|
||||
replace("\\b" + key, CONSTRUCTORS[key] + '["constructor"]');
|
||||
}
|
||||
|
||||
for (key in SIMPLE){
|
||||
replace(key, SIMPLE[key]);
|
||||
}
|
||||
|
||||
replace('(\\d\\d+)', numberReplacer);
|
||||
replace('\\((\\d)\\)', digitReplacer);
|
||||
replace('\\[(\\d)\\]', digitReplacer);
|
||||
|
||||
replace("GLOBAL", GLOBAL);
|
||||
replace('\\+""', "+[]");
|
||||
replace('""', "[]+[]");
|
||||
|
||||
MAPPING[character] = value;
|
||||
}
|
||||
}
|
||||
|
||||
function replaceStrings(){
|
||||
var regEx = /[^\[\]\(\)\!\+]{1}/g,
|
||||
all, value, missing,
|
||||
count = MAX - MIN;
|
||||
|
||||
function findMissing(){
|
||||
var all, value, done = false;
|
||||
|
||||
missing = {};
|
||||
|
||||
for (all in MAPPING){
|
||||
|
||||
value = MAPPING[all];
|
||||
|
||||
if (value.match(regEx)){
|
||||
missing[all] = value;
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
|
||||
return done;
|
||||
}
|
||||
|
||||
function mappingReplacer(a, b) {
|
||||
return b.split("").join("+");
|
||||
}
|
||||
|
||||
function valueReplacer(c) {
|
||||
return missing[c] ? c : MAPPING[c];
|
||||
}
|
||||
|
||||
for (all in MAPPING){
|
||||
MAPPING[all] = MAPPING[all].replace(/\"([^\"]+)\"/gi, mappingReplacer);
|
||||
}
|
||||
|
||||
while (findMissing()){
|
||||
for (all in missing){
|
||||
value = MAPPING[all];
|
||||
value = value.replace(regEx, valueReplacer);
|
||||
|
||||
MAPPING[all] = value;
|
||||
missing[all] = value;
|
||||
}
|
||||
|
||||
if (count-- === 0){
|
||||
console.error("Could not compile the following chars:", missing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function encode(input, wrapWithEval){
|
||||
var output = [];
|
||||
|
||||
if (!input){
|
||||
return "";
|
||||
}
|
||||
|
||||
var r = "";
|
||||
for (var i in SIMPLE) {
|
||||
r += i + "|";
|
||||
}
|
||||
r+=".";
|
||||
|
||||
input.replace(new RegExp(r, 'g'), function(c) {
|
||||
var replacement = SIMPLE[c];
|
||||
if (replacement) {
|
||||
output.push("[" + replacement + "]+[]");
|
||||
} else {
|
||||
replacement = MAPPING[c];
|
||||
if (replacement){
|
||||
output.push(replacement);
|
||||
} else {
|
||||
if (c === "J") {
|
||||
replacement =
|
||||
"([][" + encode("filter") + "]" +
|
||||
"[" + encode("constructor") + "]" +
|
||||
"(" + encode("return new Date(200000000)") + ")()+[])[!+[]+!+[]+!+[]+!+[]]";
|
||||
|
||||
output.push(replacement);
|
||||
MAPPING[c] = replacement;
|
||||
} else if (c === "O") {
|
||||
replacement =
|
||||
"([][" + encode("filter") + "]" +
|
||||
"[" + encode("constructor") + "]" +
|
||||
"(" + encode("return new Date(24000000000)") + ")()+[])[!+[]+!+[]+!+[]+!+[]]";
|
||||
|
||||
output.push(replacement);
|
||||
MAPPING[c] = replacement;
|
||||
} else {
|
||||
replacement =
|
||||
"([]+[])[" + encode("constructor") + "]" +
|
||||
"[" + encode("fromCharCode") + "]" +
|
||||
"(" + encode(c.charCodeAt(0) + "") + ")";
|
||||
|
||||
output.push(replacement);
|
||||
MAPPING[c] = replacement;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
output = output.join("+");
|
||||
|
||||
if (/^\d$/.test(input)){
|
||||
output += "+[]";
|
||||
}
|
||||
|
||||
if (wrapWithEval){
|
||||
output = "[][" + encode("filter") + "]" +
|
||||
"[" + encode("constructor") + "]" +
|
||||
"(" + output + ")()";
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
fillMissingDigits();
|
||||
fillMissingChars();
|
||||
replaceMap();
|
||||
replaceStrings();
|
||||
|
||||
self.JSFuck = {
|
||||
encode: encode
|
||||
};
|
||||
})(typeof(exports) === "undefined" ? window : exports);
|
|
@ -1,39 +0,0 @@
|
|||
<?php
|
||||
$id = '47';
|
||||
include '../../header.php';
|
||||
?>
|
||||
<div class="container">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">文本转ASCII</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<form role="form" onsubmit="return false;">
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="3" id="html_content" placeholder="输入文本"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-default btn-lg btn-block" onclick="return email2ascii();">转换</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="form-group">
|
||||
<div class="alert alert-success" role="alert" id="ascii_text" style="word-wrap : break-word ;">请输入文本进行转换</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function email2ascii(){
|
||||
|
||||
var s = document.getElementById('html_content').value;
|
||||
var as = "";
|
||||
for(var a = 0; a<s.length; a++){
|
||||
as += "&#"+s.charCodeAt(a)+";";
|
||||
}
|
||||
document.getElementById('ascii_text').innerHTML = '' + as;
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
<?php include '../../footer.php';?>
|
|
@ -1,48 +0,0 @@
|
|||
<?php
|
||||
$id = '26';
|
||||
include '../../header.php';
|
||||
?>
|
||||
|
||||
|
||||
<style>
|
||||
body{min-height:300px;background: #f6f6f6;}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.CodeMirror{min-height:385px;font-family: Menlo,Monaco,Consolas,"Andale Mono","lucida console","Courier New",monospace;}.textareaCode{min-height:100%}#iframeResult{display: block;overflow: hidden;border:0!important;min-width:100px;width:100%;min-height:385px;background-color:#fff}@media screen and (max-width:768px){.textareaCode{height:300px}.CodeMirror{height:300px;font-family: Menlo,Monaco,Consolas,"Andale Mono","lucida console","Courier New",monospace;}#iframeResult{height:300px}.form-inline{padding:6px 0 2px 0}}.logo h1{background-image:url(/images/logo-domain-white.png);background-repeat:no-repeat;text-indent:-9999px;width:160px;height:39px;margin-top:10px;display:block}
|
||||
.iframewrapper{min-height:600px;}
|
||||
</style>
|
||||
<div class="container clearfix" >
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<form class="form-inline">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div style="min-height:34px;">
|
||||
<span>输出类型:</span>
|
||||
<label><input type="radio" name="pinyin_type" value="0" checked/>带声调拼音</label>
|
||||
<label><input type="radio" name="pinyin_type" value="1"/>不带声调拼音</label>
|
||||
<label><input type="radio" name="pinyin_type" value="2"/>拼音首字母</label>
|
||||
<label><input type="checkbox" name="polyphone" title="支持多音字仅仅是将所有可能的组合列举出来,要做到准确识别多音字还需非常完善的词库"/>简单支持多音字</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="panel-body" style="height:400px;">
|
||||
<textarea class="form-control textareaCode" id="textareaCode_zw" name="textareaCode"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><button type="button" class="btn btn-default" onclick="layer.msg('如有问题请联系QQ1170535111');">拼音输出</button><button type="button" class="btn btn-default" onclick="copyUrl2();">复制内容</button><button type="button" class="btn btn-success" id="read">朗读</button></div>
|
||||
<div class="panel-body" style="height:400px;"><textarea class="form-control textareaCode" id="textareaCode_py"></textarea></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<audio id="voice" src=""></audio>
|
||||
<script type="text/javascript" src="dict/pinyin_dict_withtone.js"></script>
|
||||
<script type="text/javascript" src="pinyinUtil.js"></script>
|
||||
<script type="text/javascript" src="py.php"></script>
|
||||
|
||||
<?php include '../../footer.php';?>
|
|
@ -1 +0,0 @@
|
|||
的什么吗嘛啊了
|
|
@ -1,287 +0,0 @@
|
|||
1. 阿①ā 阿罗汉阿姨②ē 阿附 阿胶
|
||||
2. 挨①āi 挨个挨近②ái 挨打 挨说
|
||||
3. 拗①ào 拗口②niǜ 执拗
|
||||
1. 扒①bā 扒开 扒拉②pá 扒手 扒草
|
||||
2. 把①bǎ 把握 把持把柄②bà 印把 刀把 话把儿
|
||||
3. 蚌①bàng 蛤蚌②bèng 蚌埠
|
||||
4. 薄①báo (口语单用) 纸薄②bó (书面组词) 单薄 稀薄
|
||||
5. 堡 ①bǎo碉堡堡垒②bǔ瓦窑堡 吴堡③pù十里堡
|
||||
6. 暴 bào 暴露②pù 地暴十寒
|
||||
7. 背 ①bèi 脊背背静②bēi 背包 背枪
|
||||
8. 奔 ①bēn 奔跑奔波②bèn 投奔
|
||||
9. 臂 ①bì 手臂臂膀②bei 胳臂
|
||||
10. 辟 ①bì 复辟②pì 开辟
|
||||
11. 扁 ①biǎn 扁担②piān 扁舟
|
||||
12. 便 ①biàn 方便便利便宜从事②pián便宜
|
||||
13. 骠 ①biāo 黄骠马②piào骠勇
|
||||
14. 屏 ①píng屏风②bǐng 屏息 屏气
|
||||
15. 剥 ①bō (书面组词)剥削(xuē)②bāo (口语单用) 剥皮
|
||||
16. 泊 ①bó 淡泊停泊②pō 湖泊
|
||||
17. 伯 ①bó 老伯伯父②bǎi 大伯子(夫兄)
|
||||
18. 簸 ①bǒ 颠簸②bò 簸箕
|
||||
19. 膊 ①bó 赤膊②bo 胳膊
|
||||
20. 卜 ①bo 萝卜②bǔ占卜
|
||||
1. 藏 ①cáng 矿藏②zàng 宝藏
|
||||
2. 差 ①chā (书面组词)偏差 差错②chà (口语单用)差点儿 ③cī 参差
|
||||
4. 禅 ①chán 禅师②shàn 禅让 封禅
|
||||
5. 颤 ①chàn 颤动颤抖②zhàn 颤栗 打颤
|
||||
6. 场 ①chǎng 场合冷场②cháng 场院 一场(雨)
|
||||
7. 嘲 ①cháo 嘲讽嘲笑②zhāo 嘲哳(zhāo zhā)
|
||||
8. 车 ①chē 车马车辆②jū (象棋子名称)
|
||||
9. 称 ①chèng 称心对称②chēng 称呼 称道
|
||||
10. 澄 ①chéng (书面)澄清(问题)②dèng (口语)澄清(使液体变清)
|
||||
11. 匙 ①chí 汤匙②shi 钥匙
|
||||
12. 冲 ①chōng 冲锋冲击②chòng 冲床 冲子
|
||||
13. 臭 ①chòu 遗臭万年②xiù 乳臭 铜臭
|
||||
14. 处 ①chǔ (动作义)处罚 处置②chù (名词义)处所 妙处
|
||||
15. 畜 ①chù (名物义)畜牲 畜力②xù (动作义)畜养 畜牧
|
||||
16. 创 ①chuàng 创作创造②chuāng 重创 创伤
|
||||
17. 绰 ①chuò 绰绰有作②chāo 绰起
|
||||
18. 伺 ①cì 伺侯②sì 伺机 环伺
|
||||
19. 枞 ①cōng 枞树②zōng 枞阳(地名)
|
||||
20. 攒 ①cuán 攒动攒射②zǎn 积攒
|
||||
21. 撮 ①cuō 一撮儿盐②zuǒ 一撮毛
|
||||
常用多音字大全(D部)
|
||||
1. 答 ①dá 报答 答复②dā 答理 答应
|
||||
2. 大 ①dà 大夫(官名)②dài 大夫(医生)山大王
|
||||
3. 逮 ①dài (书面组词)逮捕②dǎi (口语单用)逮蚊子 逮小偷
|
||||
4. 单 ①dán 单独孤单②chán 单于③shàn 单县 单姓
|
||||
5. 当 ①dāng 当天 当时当年(均指已过去)②dàng 当天 当日 当年(同一年. 月. 日. 天)
|
||||
6. 倒 ①dǎo 颠倒 倒戈倒嚼②dào 倒粪 倒药 倒退
|
||||
7. 提 ①dī 提防 提溜②tí 提高 提取
|
||||
8. 得 ①dé 得意洋洋②de 好得很③děi 得喝水了
|
||||
9. 的 ①dí 的当 的确②dì 目的 中的③de 好的 我的
|
||||
10. 都 ①dōu 都来了②dū 都市 大都(大多)
|
||||
11. 掇 ①duō 采掇 (拾取. 采取义)②duo 撺掇 掂掇
|
||||
12. 度 ①duó 忖度揣度②dù 程度 度量
|
||||
13. 囤 ①dùn 粮囤②tún 囤积
|
||||
常用多音字大全(F部)
|
||||
1. 发 ①fà 理发 结发②fā 发表 打发
|
||||
2. 坊 ①fāng 牌坊坊巷②fáng 粉坊 染坊
|
||||
3. 分 ①fēn 区分分数②fèn 身分 分子(一员)
|
||||
4. 缝 ①féng 缝合②fèng 缝隙
|
||||
5. 服 ①fú 服毒 服药②fù 量词,也作“付”
|
||||
常用多音字大全(G部)
|
||||
1. 杆 ① gān 旗杆栏杆(粗. 长)② gǎn 枪杆 烟杆(细. 短)
|
||||
2. 葛 ① gé 葛巾 瓜葛② gě 姓氏
|
||||
3. 革 ① gé 革命 皮革② jí 病革 病急
|
||||
4. 合 ① gě 十分之一升② hé 合作 合计
|
||||
5. 给 ① gěi (口语单用)给……② jǐ (书面组词)补给. 配给
|
||||
6. 更 ① gēng 更换更事② gèng 更加 更好
|
||||
7. 颈 ① jǐng 颈项颈联② gěng 脖颈子
|
||||
8. 供 ① gōng 供给供销② gòng 口供 上供
|
||||
9. 枸 ① gǒu 枸杞② gōu 枸橘③ jǔ 枸橼
|
||||
10. 估 ① gū 估计. 估量② gù 估衣(唯一例词)
|
||||
12. 骨 ① gū 骨碌骨朵(仅此二例)② gǔ 骨肉 骨干
|
||||
13. 谷 ① gǔ 谷子 谷雨② yù 吐谷浑(族名)
|
||||
14. 冠 ① guān (名物义)加冠 弹冠② guàn (动作义)冠军 沐猴而冠
|
||||
15. 桧 ① guì 树名② huì 人名
|
||||
16. 过 ① guō 姓氏② guò 经过
|
||||
常用多音字大全(H部)
|
||||
1. 虾 ① há 虾蟆② xiā 对虾
|
||||
2. 哈 ① hǎ 哈达 姓哈② hà 哈什玛③ hā 哈萨克 哈腰
|
||||
3. 汗 ① hán 可汗 大汗② hàn 汗水 汗颜
|
||||
4. 巷 ① hàng 巷道② xiàng 街巷
|
||||
5. 吭 ① háng 引吭高歌② kēng 吭声
|
||||
6. 号 ① háo 呼号 号叫② hào 称号 号召
|
||||
7. 和 ① hé 和睦 和谐② hè 应和 和诗③ hú 麻将牌戏用语,意为赢④ huó 和面 和泥⑤ huò 和药两和(量词)⑥ huo 搀和搅和
|
||||
8. 貉 ① hé (书面)一丘之貉② háo (口语)貉绒 貉子
|
||||
9. 喝 ① hē 喝水② hè 喝彩 喝令
|
||||
10. 横 ① héng 横行纵横② hèng 蛮横 横财
|
||||
11. 虹 ① hóng (书面组词)彩虹 虹吸② jiàng (口语单用)
|
||||
12. 划 ① huá 划船划算② huà 划分 计划
|
||||
13. 晃 ① huǎng 明晃晃晃眼② huàng 摇晃 晃动
|
||||
14. 会 ① huì 会合都会② kuàì 会计 财会
|
||||
15. 混 ① hún 混浊混活② hùn 混合 混沌
|
||||
16. 哄 ① hǒng 哄骗② hòng 起哄
|
||||
17. 豁 ① huō 豁口② huò 豁亮 豁达
|
||||
常用多音字大全(J部)
|
||||
1. 奇 ① jī 奇偶② qí 奇怪 奇异
|
||||
2. 缉 ① jī 通缉 缉拿② qī 缉鞋口
|
||||
3. 几 ① jī 茶几 几案② jǐ 几何 几个
|
||||
4. 济 ① jǐ 济宁 济济② jì 救济 共济
|
||||
5. 纪 ① jǐ 姓氏② jì 纪念 纪律
|
||||
6. 偈 ① jì 偈语② jié (勇武)
|
||||
7. 系 ① jì 系紧缰绳系好缆绳② xì 系好马匹 系好船只
|
||||
8. 茄 ① jiā 雪茄② qié 茄子
|
||||
9. 夹 ① jiā 夹攻 夹杂② jiá 夹裤 夹袄
|
||||
10. 假 ① jiǎ 真假. 假借② jià 假期 假日
|
||||
11. 间 ① jiān 中间晚间② jiàn 间断 间谍
|
||||
12. 将 ① jiāng 将军将来② jiàng 将校 将兵
|
||||
13. 嚼 ① jiáo (口语) 嚼舌② jué (书面) 咀嚼
|
||||
14. 侥 ① jiǎo 侥幸② yáo 僬侥(传说中的矮人)
|
||||
15. 角 ① jiǎo 角落号角 口角(嘴角)② jué 角色 角斗 口角(吵嘴)
|
||||
16. 脚 ① jiǎo 根脚脚本② jué 脚儿(角儿,脚色)
|
||||
17. 剿 ① jiǎo 围剿剿匪② chāo 剿袭 剿说
|
||||
18. 教 ① jiāo 教书教给② jiào 教导 教派
|
||||
19. 校 ① jiào 校场校勘② xiào 学校 院校
|
||||
20. 解 ① jiě 解除解渴② jiè 解元 押解③ xiè 解县 解不开
|
||||
21. 结 ① jiē 结果结实② jié 结网 结合
|
||||
22. 芥 ① jiè 芥菜芥末② gài 芥蓝
|
||||
23. 藉 ① jiè 枕藉慰藉② jí 狼藉
|
||||
24. 矜 ① jīn 矜夸矜持② qín 矜(矛柄)锄镰棘矜
|
||||
25. 仅 ① jǐn 仅有② jìn 仅万(将近)
|
||||
26. 劲 ① jìn 干劲劲头② jìng 强劲 劲草
|
||||
27. 龟 ① jūn 龟裂② guī 乌龟③ qiū 龟兹
|
||||
28. 咀 ① jǔ 咀嚼② zuǐ 嘴
|
||||
29. 矩 ① jǔ 矩形② ju 规矩
|
||||
30. 菌 ① jūn 细菌霉菌② jùn 香菌 菌子(同蕈xùn)
|
||||
常用多音字大全(K部)
|
||||
1. 卡 ① kǎ 卡车 卡片② qiǎ 关卡 卡子
|
||||
2. 看 ① kān 看守 看管② kàn 看待 看茶
|
||||
3. 坷 ① kē 坷垃② kě 坎坷
|
||||
4. 壳 ① ké (口语)贝壳脑壳② qià (书面)地壳 甲壳. 躯壳
|
||||
5. 可 ① kě 可恨 可以② kè 可汗
|
||||
6. 克 ① kè 克扣 克服② kēi (口语)申斥
|
||||
7. 空 ① kōng 领空空洞② kòng 空白 空闲
|
||||
8. 溃 ① kuì 溃决 溃败② kui 溃=殒
|
||||
常用多音字大全(L部)
|
||||
1. 蓝 ① lán 蓝草 蓝图② lan 苤蓝(piě lan)
|
||||
2. 烙 ① lào 烙印 烙铁② luò 炮(páo)烙
|
||||
3. 勒 ① lè (书面组词)勒令 . 勒索② lēi (口语单用)勒紧点儿
|
||||
4. 擂 ① léi 擂鼓② lèi 擂台 打擂(仅此二词)
|
||||
5. 累 ① lèi (受劳义)劳累② léi (多余义)累赘③ lěi (牵连义) 牵累
|
||||
6. 蠡 ① lí 管窥蠡测② lǐ 蠡县
|
||||
7. 俩 ① liǎ (口语,不带量词)咱俩 俩人② liǎng 伎俩
|
||||
8. 量 ① liáng 丈量计量② liàng 量入为出③ liang 打量 掂量
|
||||
9. 踉 ① liáng 跳踉(跳跃)② liàng 踉跄(走路不稳)
|
||||
10. 潦 ① liáo 潦草潦倒② lǎo (书面)积潦(积水)
|
||||
11. 淋 ① lín 淋浴淋漓② lìn 淋硝 淋盐
|
||||
12. 馏 ① liú 蒸馏② liù (口语单用)馏饭
|
||||
13. 镏 ① liú 镏金(涂金)② liù 金镏(金戒)
|
||||
14. 碌 ① liù 碌碡② lù 庸碌 劳碌
|
||||
15. 笼 ① lóng (名物义)笼子. 牢笼② lǒng (动作义)笼络 笼统
|
||||
16. 偻 ① ló 佝偻② lǚ 伛偻
|
||||
17. 露 ① lù (书面)露天露骨② lòu (口语)露头 露马脚
|
||||
18. 捋 ① lǚ 捋胡子② luō 捋袖子
|
||||
19. 绿 ① lǜ (口语)绿地绿菌② lù (书面)绿林 鸭绿江
|
||||
20. 络 ① luò 络绎经络② lào 络子
|
||||
21. 落 ① luò (书面组词)落魄 着落② lào (常用口语)落枕 落色③ là (遗落义)丢三落四 落下
|
||||
常用多音字大全(M部)
|
||||
1. 脉 ① mò 脉脉(仅此一例)② mài 脉络 山脉
|
||||
2. 埋 ① mái 埋伏 埋藏② mán 埋怨
|
||||
3. 蔓 ① màn (书面)蔓延枝蔓② wàn (口语)瓜蔓 压蔓
|
||||
4. 氓 ① máng 流氓② méng 古指百姓
|
||||
5. 蒙 ① méng 蒙骗② méng 蒙味③ měng 蒙古
|
||||
6. 眯 ① mí 眯眼(迷眼)② mī 眯眼(合眼)
|
||||
7. 靡 ① mí 靡费 奢靡② mǐ 委靡 披靡
|
||||
8. 秘 ① bì 秘鲁 秘姓② mì 秘密 秘诀③ bèi 秘姓
|
||||
9. 泌 ① mì (口语)分泌② bì (书面)泌阳
|
||||
10. 模 ① mó 模范 模型② mú 模具 模样
|
||||
11. 摩 ① mó 摩擦. 摩挲(用手抚摸)② mā 摩挲(sa)轻按着并移动
|
||||
12. 缪 ① móu 绸缪② miù 纰缪③ miào 缪姓
|
||||
常用多音字大全(N部)
|
||||
1. 难 ① nán 困难难兄难弟(贬义)② nàn 责难 难兄难弟(共患难的人);
|
||||
2. 宁 ① níng 安宁宁静② nìng 宁可 宁姓
|
||||
3. 弄 ① nòng 玩弄② lòng 弄堂
|
||||
4. 疟 ① nüè (书面)疟疾② yào (口语)发疟子
|
||||
5. 娜 ① nuó 袅娜. 婀娜② nà (用于人名)安娜
|
||||
常用多音字大全(P部)
|
||||
1. 排 ① pái 排除 排行② pǎi 排车
|
||||
2. 迫 ① pǎi 迫击炮② pò 逼迫
|
||||
3. 胖 ① pán 心广体胖② pàng 肥胖
|
||||
4. 刨 ① páo 刨除 刨土② bào 刨床 刨冰
|
||||
5. 炮 ① páo 炮制. 炮格(烙)② pào 火炮 高炮
|
||||
6. 喷 ① pēn 喷射 喷泉② pèn 喷香③ pen 嚏喷
|
||||
7. 片 ① piàn 影片儿② piān 唱片儿
|
||||
8. 缥 ① piāo 缥缈② piǎo 缥—青白色(的丝织品)
|
||||
9. 撇 ① piē 撇开 撇弃② piě 撇嘴. 撇置脑后
|
||||
10. 仆 ① pū 前仆后继② pú 仆从
|
||||
11. 朴 ① pǔ 俭朴 朴质② pō 朴刀③ pò 厚朴. 朴树④ piáo 朴姓
|
||||
12. 瀑 ① pù 瀑布② bào 瀑河(水名)
|
||||
13. 曝 ① pù 一曝十寒② bào 曝光
|
||||
常用多音字大全(Q部)
|
||||
1. 栖 ① qī 两栖. 栖息② xī 栖栖
|
||||
2. 蹊 ① qī 蹊跷② xī 蹊径
|
||||
3. 稽 ① qí 稽首② jī 滑稽
|
||||
4. 荨 ① qián (书面)荨麻② xún (口语)荨麻疹
|
||||
5. 欠 ① qiàn 欠缺. 欠债② qian 呵欠
|
||||
6. 镪 ① qiāng 镪水② qiǎng 银镪
|
||||
7. 强 ① qiáng 强渡. 强取. 强制② qiǎng 勉强. 强迫. 强词③ jiàng 倔强
|
||||
8. 悄 ① qiāo 悄悄儿的悄悄话② qiǎo 悄然. 悄寂
|
||||
9. 翘 ① qiào (口语)翘尾巴② qiáo 翘首. 连翘
|
||||
10. 切 ① qiē 切磋. 切割② qiè 急切. 切实
|
||||
11. 趄 ① qiè 趄坡儿② qie 趔趄③ jū 趑趄
|
||||
12. 亲 ① qīn 亲近亲密② qìng 亲家
|
||||
13. 曲 ① qū 神曲. 大曲. 弯曲② qǔ 曲调. 曲艺. 曲牌
|
||||
14. 雀 ① qùe 雀盲. 雀斑② qiao 雀子. ③ qiao 家雀儿
|
||||
常用多音字大全(R部)
|
||||
1. 任 ① rén 任丘(地名)任(姓)② rèn 任务. 任命
|
||||
常用多音字大全(S部)
|
||||
1. 散 ① sǎn 懒散. 零散(不集中. 分散)② san 零散(散架. 破裂义)③ sàn 散布. 散失
|
||||
2. 丧 ① sāng 丧乱. 丧钟② sàng 丧失. 丧权③ sang 哭丧着脸
|
||||
3. 色 ① sè (书面)色彩色泽② shǎi (口语)落色. 颜色
|
||||
4. 塞 ① sè (书面,动作义)堵塞. 阻塞② sāi (口语,名动义)活塞. 塞车③ sài 塞翁失马 边塞 塞外
|
||||
5. 煞 ① shā 煞尾. 收煞② shà 煞白. 恶煞
|
||||
6. 厦 ① shà 广厦. 大厦② xià 厦门. 噶厦
|
||||
7. 杉 ① shān (书面)红杉. 水杉② shā (口语)杉篙. 杉木
|
||||
8. 苫 ① shàn (动作义)苫屋草② shān (名物义)草苫子
|
||||
9. 折 ① shé 折本② shē 折腾③ shé 折合
|
||||
10. 舍 ① shě 舍弃抛舍② shè 校舍 退避三舍)
|
||||
11. 什 ① shén 什么② shí 什物 什锦
|
||||
12. 葚 ① shèn (书面)桑葚② rèn (口语)桑葚儿
|
||||
13. 识 ① shí 识别识字② zhì 标识 博闻强识
|
||||
14. 似 ① shì 似的② sì 相似
|
||||
15. 螫 ① shì (书面)② zhē (口语)=蜇
|
||||
16. 熟 ① sh 相似
|
||||
17. 螫 ① shì (书面)② zhē (口语)=蜇
|
||||
18. shuì 游说 说客② shuō 说话 说辞
|
||||
19. 数 ① shuò 数见不鲜② shǔ 数落 数数(shu)③ shù 数字 数目
|
||||
20. 遂 ① suí 不遂毛遂② suì 半身不遂
|
||||
21. 缩 ① suō 缩小收缩② sù 缩砂(植物名)
|
||||
常用多音字大全(T部)
|
||||
1. 沓 ① tà 杂沓 复沓纷至沓来② ta 疲沓
|
||||
2. 苔 ① tái (书面)苍苔苔藓② tāi (口语)青苔 舌苔
|
||||
3. 调 ① tiáo 调皮调配(调和配合)② diào 调换 调配(调动分配)
|
||||
4. 帖 ① tiē 妥帖 伏帖② ti wǎ 瓦当 瓦蓝 砖瓦② wà 瓦刀 瓦屋瓦(wǎ)
|
||||
常用多音字大全(W部)
|
||||
1. 圩 ① wéi 圩子② xū 圩场
|
||||
2. 委 ① wēi 委蛇=逶迤② wěi 委曲(qū) 委屈(qu)
|
||||
3. 尾 ① wěi 尾巴② yǐ 马尾
|
||||
4. 尉 ① wèi 尉官 尉姓② yù 尉迟(姓)尉犁(地名)
|
||||
5. 乌 ① wū 乌黑. 乌拉(la 藏奴劳役)② wù 乌拉(la 草名)※ 乌黑. 乌拉(la 藏奴劳役)② wù 乌拉(la 草名)
|
||||
常用多音字大全(X部)
|
||||
1. 吓 ① xiā 吓唬 吓人② hè 威吓 恐吓
|
||||
2. 鲜 ① xiān 鲜美鲜明② xiǎn 鲜见 鲜为人知
|
||||
3. 纤 ① xiān 纤维纤细② qiàn 纤夫 拉纤
|
||||
4. 相 ① xiāng 相处相对② xiàng 相片 相机
|
||||
5. 行 ① xíng 举行发行② háng 行市. 行伍③ hàng 树行子④ héng 道行
|
||||
6. 省 ① xǐng 反省省亲② shěng 省份 省略
|
||||
7. 宿 ① xiù 星宿,二十八宿② xiǔ 半宿(用以计夜)③ sù 宿舍 宿主
|
||||
8. 削 ① xuē (书面) 剥削 瘦削② xiāo (口语) 切削 削皮
|
||||
9. 血 ① xuè (书面组词)贫血 心血② xiě (口语常用)鸡血,流了点血
|
||||
10. 熏 ① xūn 熏染熏陶② xùn 被煤气熏着了(中毒)
|
||||
常用多音字大全(Y部)
|
||||
1. 哑 ① yā 哑哑(象声词)的学语② yǎ 哑然 哑场
|
||||
2. 殷 ① yān 殷红② yīn 殷实,殷切. 殷朝③ yǐn 殷殷(象声词,形容雷声)
|
||||
3. 咽 ① yān 咽喉② yàn 狼吞虎咽③ yè 呜咽
|
||||
4. 钥 ① yào (口语)钥匙② yuè (书面)锁钥
|
||||
5. 叶 ① yè 叶落归根② xié 叶韵(和谐义)
|
||||
6. 艾 ① yì 自怨自艾. 惩艾② ài 方兴未艾. 艾草
|
||||
7. 应 ① yīng 应届应许② yìng 应付 应承
|
||||
8. 佣 ① yōng 雇佣佣工② yòng 佣金 佣钱
|
||||
9. 熨 ① yù 熨贴② yùn 熨烫
|
||||
10. 与 ① yǔ 给与② yù 参与
|
||||
11. 吁 ① yù 呼吁. 吁求② yū 吆喝牲口(象形词)③ xū 长吁短叹 气喘吁吁
|
||||
12. 晕 ① yūn 晕倒头晕② yùn 月晕 晕车
|
||||
常用多音字大全(Z部)
|
||||
1. 载 ① zǎi 登载 转载千载难逢② zài 装载 载运 载歌载舞
|
||||
2. 择 ① zé 选择 抉择② zhái 择菜 择席 择不开(仅此三词)
|
||||
3. 扎 ① zhá 挣扎② zhā 扎根 扎实③ zā 扎彩(捆束义)一扎啤酒
|
||||
4. 轧 ① zhá 轧钢 轧辊 (挤制义)② yà 倾轧 轧花 轧场(碾压义)
|
||||
5. 粘 ① zhān (动词义)粘贴 粘连② nián (形容词)粘稠 粘土
|
||||
6. 涨 ① zhǎng 涨落高涨② zhàng 泡涨 脑涨
|
||||
7. 着 ① zháo 着急 着迷着凉② zhuó 着落 着重 着手③ zhāo 失着 着数 高着(招)
|
||||
8. 正 ① zhēng 正月正旦(农历正月初一)② zhèng 正常 正旦(戏中称女主角)
|
||||
9. 殖 ① zhí 繁殖 殖民② shi 骨殖
|
||||
10. 中 ① zhōng 中国. 人中(穴位)② zhòng 中奖 中靶
|
||||
11. 种 ① zhǒng 种类种族 点种(种子)② zhòng 耕种 种植 点种(播种)
|
||||
12. 轴 ① zhóu 画轴轮轴② zhòu 大轴戏 压轴戏
|
||||
13. 属 ① zhǔ 属望 属文属意② shǔ 种属 亲属
|
||||
14. 著 ① zhù 著名著述② zhe 同“着”助词③ zhúo 同“着”动词 穿著 附著
|
||||
15. 转 ① zhuǎn 转运转折② zhuàn 转动 转速
|
||||
16. 幢 ① zhuàng 一幢楼房② chuáng 经幢
|
||||
17. 综 ① zèng 织机零件之一② zōng 综合 错综
|
||||
18. 钻 ① zuān 钻探钻孔② zuàn 钻床 钻杆
|
||||
19. 柞 ① zuò 柞蚕柞绸② zhà 柞水(在陕西)
|
||||
20. 作 ① zuō 作坊铜器作② zuò 工作 习作
|
|
@ -1,360 +0,0 @@
|
|||
|
||||
/**
|
||||
* 汉字与拼音互转工具,根据导入的字典文件的不同支持不同
|
||||
* 对于多音字目前只是将所有可能的组合输出,准确识别多音字需要完善的词库,而词库文件往往比字库还要大,所以不太适合web环境。
|
||||
* @start 2016-09-26
|
||||
* @last 2016-09-29
|
||||
*/
|
||||
;(function(global, factory) {
|
||||
if (typeof module === "object" && typeof module.exports === "object") {
|
||||
module.exports = factory(global);
|
||||
} else {
|
||||
factory(global);
|
||||
}
|
||||
})(typeof window !== "undefined" ? window : this, function(window) {
|
||||
|
||||
|
||||
var dict = {}; // 存储所有字典数据
|
||||
var pinyinUtil =
|
||||
{
|
||||
/**
|
||||
* 解析各种字典文件,所需的字典文件必须在本JS之前导入
|
||||
*/
|
||||
parseDict: function()
|
||||
{
|
||||
// 如果导入了 pinyin_dict_firstletter.js
|
||||
if(window.pinyin_dict_firstletter)
|
||||
{
|
||||
dict.firstletter = pinyin_dict_firstletter;
|
||||
}
|
||||
// 如果导入了 pinyin_dict_notone.js
|
||||
if(window.pinyin_dict_notone)
|
||||
{
|
||||
dict.notone = {};
|
||||
dict.py2hz = pinyin_dict_notone; // 拼音转汉字
|
||||
for(var i in pinyin_dict_notone)
|
||||
{
|
||||
var temp = pinyin_dict_notone[i];
|
||||
for(var j=0, len=temp.length; j<len; j++)
|
||||
{
|
||||
if(!dict.notone[temp[j]]) dict.notone[temp[j]] = i; // 不考虑多音字
|
||||
}
|
||||
}
|
||||
}
|
||||
// 如果导入了 pinyin_dict_withtone.js
|
||||
if(window.pinyin_dict_withtone)
|
||||
{
|
||||
dict.withtone = {}; // 汉字与拼音映射,多音字用空格分开,类似这种结构:{'大': 'da tai'}
|
||||
var temp = pinyin_dict_withtone.split(',');
|
||||
for(var i=0, len = temp.length; i<len; i++)
|
||||
{
|
||||
// 这段代码耗时28毫秒左右,对性能影响不大,所以一次性处理完毕
|
||||
dict.withtone[String.fromCharCode(i + 19968)] = temp[i]; // 这里先不进行split(' '),因为一次性循环2万次split比较消耗性能
|
||||
}
|
||||
|
||||
// 拼音 -> 汉字
|
||||
if(window.pinyin_dict_notone)
|
||||
{
|
||||
// 对于拼音转汉字,我们优先使用pinyin_dict_notone字典文件
|
||||
// 因为这个字典文件不包含生僻字,且已按照汉字使用频率排序
|
||||
dict.py2hz = pinyin_dict_notone; // 拼音转汉字
|
||||
}
|
||||
else
|
||||
{
|
||||
// 将字典文件解析成拼音->汉字的结构
|
||||
// 与先分割后逐个去掉声调相比,先一次性全部去掉声调然后再分割速度至少快了3倍,前者大约需要120毫秒,后者大约只需要30毫秒(Chrome下)
|
||||
var notone = pinyinUtil.removeTone(pinyin_dict_withtone).split(',');
|
||||
var py2hz = {}, py, hz;
|
||||
for(var i=0, len = notone.length; i<len; i++)
|
||||
{
|
||||
hz = String.fromCharCode(i + 19968); // 汉字
|
||||
py = notone[i].split(' '); // 去掉了声调的拼音数组
|
||||
for(var j=0; j<py.length; j++)
|
||||
{
|
||||
py2hz[py[j]] = (py2hz[py[j]] || '') + hz;
|
||||
}
|
||||
}
|
||||
dict.py2hz = py2hz;
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 根据汉字获取拼音,如果不是汉字直接返回原字符
|
||||
* @param chinese 要转换的汉字
|
||||
* @param splitter 分隔字符,默认用空格分隔
|
||||
* @param withtone 返回结果是否包含声调,默认是
|
||||
* @param polyphone 是否支持多音字,默认否
|
||||
*/
|
||||
getPinyin: function(chinese, splitter, withtone, polyphone)
|
||||
{
|
||||
if(!chinese || /^ +$/g.test(chinese)) return '';
|
||||
splitter = splitter == undefined ? ' ' : splitter;
|
||||
withtone = withtone == undefined ? true : withtone;
|
||||
polyphone = polyphone == undefined ? false : polyphone;
|
||||
var result = [];
|
||||
if(dict.withtone) // 优先使用带声调的字典文件
|
||||
{
|
||||
var noChinese = '';
|
||||
for (var i=0, len = chinese.length; i < len; i++)
|
||||
{
|
||||
var pinyin = dict.withtone[chinese[i]];
|
||||
if(pinyin)
|
||||
{
|
||||
// 如果不需要多音字,默认返回第一个拼音,后面的直接忽略
|
||||
// 所以这对数据字典有一定要求,常见字的拼音必须放在最前面
|
||||
if(!polyphone) pinyin = pinyin.replace(/ .*$/g, '');
|
||||
if(!withtone) pinyin = this.removeTone(pinyin); // 如果不需要声调
|
||||
//空格,把noChinese作为一个词插入
|
||||
noChinese && ( result.push( noChinese), noChinese = '' );
|
||||
result.push( pinyin );
|
||||
}
|
||||
else if ( !chinese[i] || /^ +$/g.test(chinese[i]) ){
|
||||
//空格,把noChinese作为一个词插入
|
||||
noChinese && ( result.push( noChinese), noChinese = '' );
|
||||
}
|
||||
else{
|
||||
noChinese += chinese[i];
|
||||
}
|
||||
}
|
||||
if ( noChinese ){
|
||||
result.push( noChinese);
|
||||
noChinese = '';
|
||||
}
|
||||
}
|
||||
else if(dict.notone) // 使用没有声调的字典文件
|
||||
{
|
||||
if(withtone) console.warn('pinyin_dict_notone 字典文件不支持声调!');
|
||||
if(polyphone) console.warn('pinyin_dict_notone 字典文件不支持多音字!');
|
||||
var noChinese = '';
|
||||
for (var i=0, len = chinese.length; i < len; i++)
|
||||
{
|
||||
var temp = chinese.charAt(i),
|
||||
pinyin = dict.notone[temp];
|
||||
if ( pinyin ){ //插入拼音
|
||||
//空格,把noChinese作为一个词插入
|
||||
noChinese && ( result.push( noChinese), noChinese = '' );
|
||||
result.push( pinyin );
|
||||
}
|
||||
else if ( !temp || /^ +$/g.test(temp) ){
|
||||
//空格,插入之前的非中文字符
|
||||
noChinese && ( result.push( noChinese), noChinese = '' );
|
||||
}
|
||||
else {
|
||||
//非空格,关联到noChinese中
|
||||
noChinese += temp;
|
||||
}
|
||||
}
|
||||
|
||||
if ( noChinese ){
|
||||
result.push( noChinese );
|
||||
noChinese = '';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw '抱歉,未找到合适的拼音字典文件!';
|
||||
}
|
||||
if(!polyphone) return result.join(splitter);
|
||||
else
|
||||
{
|
||||
if(window.pinyin_dict_polyphone) return parsePolyphone(chinese, result, splitter, withtone);
|
||||
else return handlePolyphone(result, ' ', splitter);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取汉字的拼音首字母
|
||||
* @param str 汉字字符串,如果遇到非汉字则原样返回
|
||||
* @param polyphone 是否支持多音字,默认false,如果为true,会返回所有可能的组合数组
|
||||
*/
|
||||
getFirstLetter: function(str, polyphone)
|
||||
{
|
||||
polyphone = polyphone == undefined ? false : polyphone;
|
||||
if(!str || /^ +$/g.test(str)) return '';
|
||||
if(dict.firstletter) // 使用首字母字典文件
|
||||
{
|
||||
var result = [];
|
||||
for(var i=0; i<str.length; i++)
|
||||
{
|
||||
var unicode = str.charCodeAt(i);
|
||||
var ch = str.charAt(i);
|
||||
if(unicode >= 19968 && unicode <= 40869)
|
||||
{
|
||||
ch = dict.firstletter.all.charAt(unicode-19968);
|
||||
if(polyphone) ch = dict.firstletter.polyphone[unicode] || ch;
|
||||
}
|
||||
result.push(ch);
|
||||
}
|
||||
if(!polyphone) return result.join(''); // 如果不用管多音字,直接将数组拼接成字符串
|
||||
else return handlePolyphone(result, '', ''); // 处理多音字,此时的result类似于:['D', 'ZC', 'F']
|
||||
}
|
||||
else
|
||||
{
|
||||
var py = this.getPinyin(str, ' ', false, polyphone);
|
||||
py = py instanceof Array ? py : [py];
|
||||
var result = [];
|
||||
for(var i=0; i<py.length; i++)
|
||||
{
|
||||
result.push(py[i].replace(/(^| )(\w)\w*/g, function(m,$1,$2){return $2.toUpperCase();}));
|
||||
}
|
||||
if(!polyphone) return result[0];
|
||||
else return simpleUnique(result);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 拼音转汉字,只支持单个汉字,返回所有匹配的汉字组合
|
||||
* @param pinyin 单个汉字的拼音,可以包含声调
|
||||
*/
|
||||
getHanzi: function(pinyin)
|
||||
{
|
||||
if(!dict.py2hz)
|
||||
{
|
||||
throw '抱歉,未找到合适的拼音字典文件!';
|
||||
}
|
||||
return dict.py2hz[this.removeTone(pinyin)] || '';
|
||||
},
|
||||
/**
|
||||
* 获取某个汉字的同音字,本方法暂时有问题,待完善
|
||||
* @param hz 单个汉字
|
||||
* @param sameTone 是否获取同音同声调的汉字,必须传进来的拼音带声调才支持,默认false
|
||||
*/
|
||||
getSameVoiceWord: function(hz, sameTone)
|
||||
{
|
||||
sameTone = sameTone || false
|
||||
return this.getHanzi(this.getPinyin(hz, ' ', false))
|
||||
},
|
||||
/**
|
||||
* 去除拼音中的声调,比如将 xiǎo míng tóng xué 转换成 xiao ming tong xue
|
||||
* @param pinyin 需要转换的拼音
|
||||
*/
|
||||
removeTone: function(pinyin)
|
||||
{
|
||||
var toneMap =
|
||||
{
|
||||
"ā": "a1",
|
||||
"á": "a2",
|
||||
"ǎ": "a3",
|
||||
"à": "a4",
|
||||
"ō": "o1",
|
||||
"ó": "o2",
|
||||
"ǒ": "o3",
|
||||
"ò": "o4",
|
||||
"ē": "e1",
|
||||
"é": "e2",
|
||||
"ě": "e3",
|
||||
"è": "e4",
|
||||
"ī": "i1",
|
||||
"í": "i2",
|
||||
"ǐ": "i3",
|
||||
"ì": "i4",
|
||||
"ū": "u1",
|
||||
"ú": "u2",
|
||||
"ǔ": "u3",
|
||||
"ù": "u4",
|
||||
"ü": "v0",
|
||||
"ǖ": "v1",
|
||||
"ǘ": "v2",
|
||||
"ǚ": "v3",
|
||||
"ǜ": "v4",
|
||||
"ń": "n2",
|
||||
"ň": "n3",
|
||||
"": "m2"
|
||||
};
|
||||
return pinyin.replace(/[āáǎàōóǒòēéěèīíǐìūúǔùüǖǘǚǜńň]/g, function(m){ return toneMap[m][0]; });
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 处理多音字,将类似['D', 'ZC', 'F']转换成['DZF', 'DCF']
|
||||
* 或者将 ['chang zhang', 'cheng'] 转换成 ['chang cheng', 'zhang cheng']
|
||||
*/
|
||||
function handlePolyphone(array, splitter, joinChar)
|
||||
{
|
||||
splitter = splitter || '';
|
||||
var result = [''], temp = [];
|
||||
for(var i=0; i<array.length; i++)
|
||||
{
|
||||
temp = [];
|
||||
var t = array[i].split(splitter);
|
||||
for(var j=0; j<t.length; j++)
|
||||
{
|
||||
for(var k=0; k<result.length; k++)
|
||||
temp.push(result[k] + (result[k]?joinChar:'') + t[j]);
|
||||
}
|
||||
result = temp;
|
||||
}
|
||||
return simpleUnique(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据词库找出多音字正确的读音
|
||||
* 这里只是非常简单的实现,效率和效果都有一些问题
|
||||
* 推荐使用第三方分词工具先对句子进行分词,然后再匹配多音字
|
||||
* @param chinese 需要转换的汉字
|
||||
* @param result 初步匹配出来的包含多个发音的拼音结果
|
||||
* @param splitter 返回结果拼接字符
|
||||
*/
|
||||
function parsePolyphone(chinese, result, splitter, withtone)
|
||||
{
|
||||
var poly = window.pinyin_dict_polyphone;
|
||||
var max = 7; // 最多只考虑7个汉字的多音字词,虽然词库里面有10个字的,但是数量非常少,为了整体效率暂时忽略之
|
||||
var temp = poly[chinese];
|
||||
if(temp) // 如果直接找到了结果
|
||||
{
|
||||
temp = temp.split(' ');
|
||||
for(var i=0; i<temp.length; i++)
|
||||
{
|
||||
result[i] = temp[i] || result[i];
|
||||
if(!withtone) result[i] = pinyinUtil.removeTone(result[i]);
|
||||
}
|
||||
return result.join(splitter);
|
||||
}
|
||||
for(var i=0; i<chinese.length; i++)
|
||||
{
|
||||
temp = '';
|
||||
for(var j=0; j<max && (i+j)<chinese.length; j++)
|
||||
{
|
||||
if(!/^[\u2E80-\u9FFF]+$/.test(chinese[i+j])) break; // 如果碰到非汉字直接停止本次查找
|
||||
temp += chinese[i+j];
|
||||
var res = poly[temp];
|
||||
if(res) // 如果找到了多音字词语
|
||||
{
|
||||
res = res.split(' ');
|
||||
for(var k=0; k<=j; k++)
|
||||
{
|
||||
if(res[k]) result[i+k] = withtone ? res[k] : pinyinUtil.removeTone(res[k]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 最后这一步是为了防止出现词库里面也没有包含的多音字词语
|
||||
for(var i=0; i<result.length; i++)
|
||||
{
|
||||
result[i] = result[i].replace(/ .*$/g, '');
|
||||
}
|
||||
return result.join(splitter);
|
||||
}
|
||||
|
||||
// 简单数组去重
|
||||
function simpleUnique(array)
|
||||
{
|
||||
var result = [];
|
||||
var hash = {};
|
||||
for(var i=0; i<array.length; i++)
|
||||
{
|
||||
var key = (typeof array[i]) + array[i];
|
||||
if(!hash[key])
|
||||
{
|
||||
result.push(array[i]);
|
||||
hash[key] = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
pinyinUtil.parseDict();
|
||||
pinyinUtil.dict = dict;
|
||||
window.pinyinUtil = pinyinUtil;
|
||||
|
||||
});
|
|
@ -1,122 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>带词库识别多音字的汉字转拼音</title>
|
||||
<link rel="stylesheet" type="text/css" href="simple-input-method/simple-input-method.css">
|
||||
<style type="text/css">
|
||||
body{font-family: 'Microsoft Yahei'; font-size: 16px;}
|
||||
* {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
input[type="text"] {
|
||||
height: 34px;
|
||||
padding: 6px 12px;
|
||||
font-size: 14px;
|
||||
line-height: 1.42857143;
|
||||
color: #555;
|
||||
background-color: #fff;
|
||||
background-image: none;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
|
||||
-webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
|
||||
transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
|
||||
}
|
||||
input[type="text"]:focus {
|
||||
border-color: #66afe9;
|
||||
outline: 0;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);
|
||||
box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);
|
||||
}
|
||||
#test {width: 300px;}
|
||||
h2 {
|
||||
background-color: #3199E4;
|
||||
color: white;
|
||||
padding: 2px 8px;
|
||||
border-radius: 5px;
|
||||
font-size: 30px;
|
||||
line-height: 1.5;
|
||||
text-shadow: 1px 1px 1px black;
|
||||
width: 800px;
|
||||
}
|
||||
h2 > span {
|
||||
color: #B10000;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
#test {margin-top: 10px;}
|
||||
.loading-tip{color: #00960A;margin-bottom: 10px;}
|
||||
.container {
|
||||
width: 1024px;
|
||||
margin: 20px auto;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<a href="http://blog.haoji.me/pinyinjs.html" target="_blank">返回原文</a>
|
||||
<a href="http://github.com/sxei/pinyinjs/" target="_blank">github地址</a>
|
||||
<a href="http://demo.haoji.me/pinyinjs/" target="_blank">返回上一页</a>
|
||||
<h2>带词库可以识别多音字的汉字转拼音</h2>
|
||||
<p>说明:本页面需要加载900多kb的词库文件,所以不太适合web环境,这里仅仅是演示效果而已,并且由于没有使用分词所以效果也不一定非常好。非要识别多音字的话,推荐在服务端完成(借助一些分词工具效果会更好,比如<a href="https://github.com/fxsjy/jieba">jieba</a>),然后做成接口给前端调用。</p>
|
||||
<div class="loading-tip">正在加载词库,文件比较大,请耐心等待加载完毕再尝试。</div>
|
||||
<div>
|
||||
<span>输出类型:</span>
|
||||
<label><input type="radio" name="pinyin_type" value="0" checked/>带声调拼音</label>
|
||||
<label><input type="radio" name="pinyin_type" value="1"/>不带声调拼音</label>
|
||||
<label><input type="radio" name="pinyin_type" value="2"/>拼音首字母</label>
|
||||
</div>
|
||||
<input type="text" id="test" value="小明说长大后要去看长城!" placeholder="请随便输入一些中文"/>
|
||||
<h3>转换结果:</h3>
|
||||
<div id="result"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="dict/pinyin_dict_withtone.js"></script>
|
||||
<script type="text/javascript" src="dict/pinyin_dict_polyphone.js"></script>
|
||||
<script type="text/javascript" src="pinyinUtil.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function getPinyin()
|
||||
{
|
||||
var value = document.getElementById('test').value;
|
||||
var type = document.querySelector('[name="pinyin_type"]:checked').value;
|
||||
var result = '';
|
||||
if(value)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case '0': result = pinyinUtil.getPinyin(value, ' ', true, true); break;
|
||||
case '1': result = pinyinUtil.getPinyin(value, ' ', false, true); break;
|
||||
case '2': result = pinyinUtil.getFirstLetter(value, true); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
var html = result;
|
||||
if(result instanceof Array)
|
||||
{
|
||||
html = '<ol>';
|
||||
result.forEach(function(val)
|
||||
{
|
||||
html += '<li>'+val+'</li>';
|
||||
});
|
||||
html += '</ol>';
|
||||
}
|
||||
document.getElementById('result').innerHTML = html;
|
||||
}
|
||||
document.getElementById('test').addEventListener('input', getPinyin);
|
||||
document.addEventListener('change', function(e)
|
||||
{
|
||||
if(e.target.name === 'pinyin_type')
|
||||
{
|
||||
getPinyin();
|
||||
}
|
||||
});
|
||||
getPinyin();
|
||||
document.querySelector('.loading-tip').innerHTML = 'JS加载完毕,现在你可以开始打字了!';
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,65 +0,0 @@
|
|||
/**
|
||||
* @act 中文转拼音
|
||||
* @version 1.0
|
||||
* @author youngxj
|
||||
* @date 2018-04-18
|
||||
* @url http://www.youngxj.cn
|
||||
*/
|
||||
|
||||
function getPinyin(){
|
||||
var value = document.getElementById('textareaCode_zw').value;
|
||||
var type = document.querySelector('[name="pinyin_type"]:checked').value;
|
||||
var polyphone = document.querySelector('[name="polyphone"]').checked;
|
||||
var result = '';
|
||||
if(value)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case '0': result = pinyinUtil.getPinyin(value, ' ', true, polyphone); break;
|
||||
case '1': result = pinyinUtil.getPinyin(value, ' ', false, polyphone); break;
|
||||
case '2': result = pinyinUtil.getFirstLetter(value, polyphone); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
var html = result;
|
||||
if(result instanceof Array)
|
||||
{
|
||||
html = '';
|
||||
result.forEach(function(val)
|
||||
{
|
||||
html += ''+val+'\r\n';
|
||||
});
|
||||
html += '';
|
||||
}
|
||||
document.getElementById('textareaCode_py').innerHTML = html;
|
||||
}
|
||||
document.getElementById('textareaCode_zw').addEventListener('input', getPinyin);
|
||||
document.getElementsByName('polyphone')[0].addEventListener('change', function(e)
|
||||
{
|
||||
getPinyin();
|
||||
});
|
||||
document.addEventListener('change', function(e)
|
||||
{
|
||||
if(e.target.name === 'pinyin_type')
|
||||
{
|
||||
getPinyin();
|
||||
}
|
||||
});
|
||||
getPinyin();
|
||||
function copyUrl2(){
|
||||
var urlresult=document.getElementById("textareaCode_py");
|
||||
urlresult.select(); // 选择对象
|
||||
document.execCommand("Copy"); // 执行浏览器复制命令
|
||||
layer.msg('手机有一定几率复制失败!');
|
||||
}
|
||||
|
||||
$("#read").click(function() {
|
||||
var voiceSrc = "https://tts.baidu.com/text2audio?lan=zh&pid=101&ie=UTF-8&text=" + urlEncode($("#textareaCode_zw").val()) + "&spd=4";
|
||||
$("#voice").attr("src", voiceSrc);
|
||||
$("#voice")[0].play();
|
||||
});
|
||||
|
||||
// url编码
|
||||
function urlEncode(str) {
|
||||
return (encodeURIComponent(str).replace(/'/g, "%27").replace(/"/g, "%22"));
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>汉字拼音互转示例</title>
|
||||
<link rel="stylesheet" type="text/css" href="simple-input-method/simple-input-method.css">
|
||||
<style type="text/css">
|
||||
body{font-family: 'Microsoft Yahei'; font-size: 16px;}
|
||||
* {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
input[type="text"] {
|
||||
height: 34px;
|
||||
padding: 6px 12px;
|
||||
font-size: 14px;
|
||||
line-height: 1.42857143;
|
||||
color: #555;
|
||||
background-color: #fff;
|
||||
background-image: none;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
|
||||
-webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
|
||||
transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
|
||||
}
|
||||
input[type="text"]:focus {
|
||||
border-color: #66afe9;
|
||||
outline: 0;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);
|
||||
box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);
|
||||
}
|
||||
#test {width: 300px;}
|
||||
h2 {
|
||||
background-color: #3199E4;
|
||||
color: white;
|
||||
padding: 2px 8px;
|
||||
border-radius: 5px;
|
||||
font-size: 30px;
|
||||
line-height: 1.5;
|
||||
text-shadow: 1px 1px 1px black;
|
||||
width: 800px;
|
||||
}
|
||||
h2 > span {
|
||||
color: #ff0d0d;
|
||||
font-size: 0.8em;
|
||||
text-shadow: 1px 1px 0px white;
|
||||
margin-left: 10px;
|
||||
}
|
||||
#test {margin-top: 10px;}
|
||||
.loading-tip{color: #00960A;margin-bottom: 10px;}
|
||||
.container {
|
||||
width: 1024px;
|
||||
margin: 20px auto;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<a href="http://blog.haoji.me/pinyinjs.html" target="_blank">返回原文</a>
|
||||
<a href="http://github.com/sxei/pinyinjs/" target="_blank">github地址</a>
|
||||
<a href="http://demo.haoji.me/pinyinjs/">返回上一页</a>
|
||||
|
||||
<h2>JS实现简单的拼音输入法<span>(请将系统输入法设置为英文):</span></h2>
|
||||
<div class="loading-tip">正在加载JS,请等待加载完毕再尝试。</div>
|
||||
<input type="text" class="test-input-method" placeholder="请在这里打字试试">
|
||||
<input type="text" class="test-input-method" placeholder="请在这里打字试试">
|
||||
<input type="text" class="test-input-method" placeholder="请在这里打字试试">
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="dict/pinyin_dict_notone.js"></script>
|
||||
<script type="text/javascript" src="pinyinUtil.js"></script>
|
||||
<script type="text/javascript" src="simple-input-method/simple-input-method.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// 初始化简单的拼音输入法
|
||||
SimpleInputMethod.init('.test-input-method');
|
||||
document.querySelector('.loading-tip').innerHTML = 'JS加载完毕,现在你可以开始打字了!';
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,52 +0,0 @@
|
|||
.simple-input-method {
|
||||
position: absolute;
|
||||
background: #FFF;
|
||||
border: solid 1px #B5C5D2;
|
||||
font-family: 'Arial';
|
||||
color: #0364CD;
|
||||
display: none;
|
||||
}
|
||||
.simple-input-method .pinyin {
|
||||
border-bottom: solid 1px #B5C5D2;
|
||||
padding: 4px 10px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.simple-input-method .result {
|
||||
padding: 4px 10px 4px 0px;
|
||||
}
|
||||
.simple-input-method .result ol {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.simple-input-method .result ol:after {
|
||||
content: '';
|
||||
display: block;
|
||||
clear: left;
|
||||
}
|
||||
.simple-input-method .result ol li {
|
||||
float: left;
|
||||
margin-left: 30px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.simple-input-method .result ol li:first-child {
|
||||
color: red;
|
||||
}
|
||||
.simple-input-method .page-up-down {
|
||||
display: inline-block;
|
||||
border: solid 1px #BADBFF;
|
||||
font-size: 12px;
|
||||
color: #4C9AEF;
|
||||
border-radius: 1px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.simple-input-method .page-up-down .page-down{
|
||||
border-left: solid 1px #BADBFF;
|
||||
}
|
||||
.simple-input-method .page-up-down span {
|
||||
cursor: pointer;
|
||||
}
|
||||
.simple-input-method .page-up-down span.disable {
|
||||
opacity: .3;
|
||||
}
|
|
@ -1,262 +0,0 @@
|
|||
/**
|
||||
* 简单的JS版输入法,拿来玩玩还而已,没有多大实际使用意义
|
||||
* simple-input-method.js
|
||||
*/
|
||||
var SimpleInputMethod =
|
||||
{
|
||||
hanzi: '', // 候选汉字
|
||||
pinyin: '', // 候选拼音
|
||||
result: [], // 当前匹配到的汉字集合
|
||||
pageCurrent: 1, // 当前页
|
||||
pageSize: 5, // 每页大小
|
||||
pageCount: 0, // 总页数
|
||||
/**
|
||||
* 初始化字典配置
|
||||
*/
|
||||
initDict: function()
|
||||
{
|
||||
var dict = pinyinUtil.dict;
|
||||
if(!dict.py2hz) throw '未找到合适的字典文件!';
|
||||
// 这一步仅仅是给字母a-z扩充,例如根据b找不到相关汉字,就把bi的结果赋值给b
|
||||
// 当然这种方式只是很简单的实现,真正的拼音输入法肯定不能这么简单处理
|
||||
dict.py2hz2 = {};
|
||||
dict.py2hz2['i'] = 'i'; // i比较特殊,没有符合的汉字,所以特殊处理
|
||||
for(var i=97; i<=123; i++)
|
||||
{
|
||||
var ch = String.fromCharCode(i);
|
||||
if(!dict.py2hz[ch])
|
||||
{
|
||||
for(var j in dict.py2hz)
|
||||
{
|
||||
if(j.indexOf(ch) == 0)
|
||||
{
|
||||
dict.py2hz2[ch] = dict.py2hz[j];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 初始化DOM结构
|
||||
*/
|
||||
initDom: function()
|
||||
{
|
||||
var temp = `<div class="pinyin"></div>
|
||||
<div class="result">
|
||||
<ol></ol>
|
||||
<div class="page-up-down"><span class="page-up">▲</span><span class="page-down">▼</span></div>
|
||||
</div>`;
|
||||
var dom = document.createElement('div');
|
||||
dom.id = 'simle_input_method';
|
||||
dom.className = 'simple-input-method';
|
||||
dom.innerHTML = temp;
|
||||
var that = this;
|
||||
// 初始化汉字选择和翻页键的点击事件
|
||||
dom.addEventListener('click', function(e)
|
||||
{
|
||||
var target = e.target;
|
||||
if(target.nodeName == 'LI') that.selectHanzi(parseInt(target.dataset.idx));
|
||||
else if(target.nodeName == 'SPAN')
|
||||
{
|
||||
if(target.className == 'page-up' && that.pageCurrent > 1)
|
||||
{
|
||||
that.pageCurrent--;
|
||||
that.refreshPage();
|
||||
}
|
||||
else if(target.className == 'page-down' && that.pageCurrent < that.pageCount)
|
||||
{
|
||||
that.pageCurrent++;
|
||||
that.refreshPage();
|
||||
}
|
||||
}
|
||||
})
|
||||
document.body.appendChild(dom);
|
||||
},
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
init: function(selector)
|
||||
{
|
||||
this.initDict();
|
||||
this.initDom();
|
||||
obj = document.querySelectorAll(selector);
|
||||
this._target = document.querySelector('#simle_input_method');
|
||||
this._pinyinTarget = document.querySelector('#simle_input_method .pinyin');
|
||||
this._resultTarget = document.querySelector('#simle_input_method .result ol');
|
||||
var that = this;
|
||||
for(var i=0; i<obj.length; i++)
|
||||
{
|
||||
obj[i].addEventListener('keydown', function(e)
|
||||
{
|
||||
var keyCode = e.keyCode;
|
||||
var preventDefault = false;
|
||||
if(keyCode >= 65 && keyCode <= 90) // A-Z
|
||||
{
|
||||
that.addChar(String.fromCharCode(keyCode+32), this);
|
||||
preventDefault = true;
|
||||
}
|
||||
else if(keyCode == 8 && that.pinyin) // 删除键
|
||||
{
|
||||
that.delChar();
|
||||
preventDefault = true;
|
||||
}
|
||||
else if(keyCode >= 48 && keyCode <= 57 && !e.shiftKey && that.pinyin) // 1-9
|
||||
{
|
||||
that.selectHanzi(keyCode-48);
|
||||
preventDefault = true;
|
||||
}
|
||||
else if(keyCode == 32 && that.pinyin) // 空格
|
||||
{
|
||||
that.selectHanzi(1);
|
||||
preventDefault = true;
|
||||
}
|
||||
else if(keyCode == 33 && that.pageCount > 0 && that.pageCurrent > 1) // 上翻页
|
||||
{
|
||||
that.pageCurrent--;
|
||||
that.refreshPage();
|
||||
preventDefault = true;
|
||||
}
|
||||
else if(keyCode == 34 && that.pageCount > 0 && that.pageCurrent < that.pageCount) // 下翻页
|
||||
{
|
||||
that.pageCurrent++;
|
||||
that.refreshPage();
|
||||
preventDefault = true;
|
||||
}
|
||||
if(preventDefault) e.preventDefault();
|
||||
});
|
||||
obj[i].addEventListener('focus', function()
|
||||
{
|
||||
// 如果选中的不是当前文本框,隐藏输入法
|
||||
if(that._input !== this) that.hide();
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 单个拼音转单个汉字,例如输入 "a" 返回 "阿啊呵腌嗄吖锕"
|
||||
*/
|
||||
getSingleHanzi: function(pinyin)
|
||||
{
|
||||
return pinyinUtil.dict.py2hz2[pinyin] || pinyinUtil.dict.py2hz[pinyin] || '';
|
||||
},
|
||||
/**
|
||||
* 拼音转汉字
|
||||
* @param pinyin 需要转换的拼音,如 zhongguo
|
||||
* @return 返回一个数组,格式类似:[["中","重","种","众","终","钟","忠"], "zhong'guo"]
|
||||
*/
|
||||
getHanzi: function(pinyin)
|
||||
{
|
||||
var result = this.getSingleHanzi(pinyin);
|
||||
if(result) return [result.split(''), pinyin];
|
||||
var temp = '';
|
||||
for(var i=0, len = pinyin.length; i<len; i++)
|
||||
{
|
||||
temp += pinyin[i];
|
||||
result = this.getSingleHanzi(temp);
|
||||
if(!result) continue;
|
||||
// flag表示如果当前能匹配到结果、并且往后5个字母不能匹配结果,因为最长可能是5个字母,如 zhuang
|
||||
var flag = false;
|
||||
if((i+1) < pinyin.length)
|
||||
{
|
||||
for(var j=1, len = pinyin.length; j<=5 && (i+j)<len; j++)
|
||||
{
|
||||
if(this.getSingleHanzi(pinyin.substr(0, i+j+1)))
|
||||
{
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!flag) return [result.split(''), pinyin.substr(0, i+1) + "'" + pinyin.substr(i+1)];
|
||||
}
|
||||
return [[], '']; // 理论上一般不会出现这种情况
|
||||
},
|
||||
/**
|
||||
* 选择某个汉字,i有效值为1-5
|
||||
*/
|
||||
selectHanzi: function(i)
|
||||
{
|
||||
var hz = this.result[(this.pageCurrent - 1) * this.pageSize + i - 1];
|
||||
if(!hz) return;
|
||||
this.hanzi += hz;
|
||||
var idx = this.pinyin.indexOf("'");
|
||||
if(idx > 0)
|
||||
{
|
||||
this.pinyin = this.pinyin.substr(idx+1);
|
||||
this.refresh();
|
||||
}
|
||||
else // 如果没有单引号,表示已经没有候选词了
|
||||
{
|
||||
this._input.value += this.hanzi;
|
||||
this.hide();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 将拼音转换成汉字候选词,并显示在界面上
|
||||
*/
|
||||
refresh: function()
|
||||
{
|
||||
var temp = this.getHanzi(this.pinyin.replace(/'/g, ''));
|
||||
this.result = temp[0];
|
||||
this.pinyin = temp[1];
|
||||
var count = this.result.length;
|
||||
this.pageCurrent = 1;
|
||||
this.pageCount = Math.ceil(count / this.pageSize);
|
||||
this._pinyinTarget.innerHTML = this.hanzi + this.pinyin;
|
||||
this.refreshPage();
|
||||
},
|
||||
refreshPage: function()
|
||||
{
|
||||
var temp = this.result.slice((this.pageCurrent-1)*this.pageSize, this.pageCurrent*this.pageSize);
|
||||
var html = '';
|
||||
var i = 0;
|
||||
temp.forEach(function(val)
|
||||
{
|
||||
html += '<li data-idx="'+(++i)+'">' + val + '</li>';
|
||||
});
|
||||
this._target.querySelector('.page-up').style.opacity = this.pageCurrent > 1 ? '1' : '.3';
|
||||
this._target.querySelector('.page-down').style.opacity = this.pageCurrent < this.pageCount ? '1' : '.3';
|
||||
this._resultTarget.innerHTML = html;
|
||||
},
|
||||
addChar: function(ch, obj)
|
||||
{
|
||||
if(this.pinyin.length == 0) // 长度为1,显示输入法
|
||||
{
|
||||
this.show(obj);
|
||||
}
|
||||
this.pinyin += ch;
|
||||
this.refresh();
|
||||
},
|
||||
delChar: function()
|
||||
{
|
||||
if(this.pinyin.length <= 1)
|
||||
{
|
||||
this.hide();
|
||||
return;
|
||||
}
|
||||
this.pinyin = this.pinyin.substr(0, this.pinyin.length-1);
|
||||
this.refresh();
|
||||
},
|
||||
show: function(obj)
|
||||
{
|
||||
var pos = obj.getBoundingClientRect();
|
||||
this._target.style.left = pos.left + 'px';
|
||||
this._target.style.top = pos.top + pos.height + document.body.scrollTop + 'px';
|
||||
this._input = obj;
|
||||
this._target.style.display = 'block';
|
||||
},
|
||||
hide: function()
|
||||
{
|
||||
this.reset();
|
||||
this._target.style.display = 'none';
|
||||
},
|
||||
reset: function()
|
||||
{
|
||||
this.hanzi = '';
|
||||
this.pinyin = '';
|
||||
this.result = [];
|
||||
this.pageCurrent = 1;
|
||||
this.pageCount = 0;
|
||||
this._pinyinTarget.innerHTML = '';
|
||||
}
|
||||
};
|
|
@ -1,28 +0,0 @@
|
|||
/**
|
||||
* @act StatusCode
|
||||
* @version 1.0
|
||||
* @author youngxj
|
||||
* @date 2018-04-20
|
||||
* @url http://www.youngxj.cn
|
||||
*/
|
||||
|
||||
var cache=getCookie('cache_url');
|
||||
$('#form-control').val(cache);
|
||||
control('请输入域名地址:');
|
||||
$("#btn_state").click(function(){
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.getJSON("https://api.yum6.cn/StatusCode.php?url="+$('.form-control').val()+"&format=StatusCode",function(result){
|
||||
if (result.code=='1') {
|
||||
setCookie('cache_url',$('.form-control').val(),365);
|
||||
document.cookie="cache_url="+$('.form-control').val();
|
||||
layer.msg('ok', {icon: 1});
|
||||
$('.form-controlss').show();
|
||||
$('#content').html('<table class="table table-bordered"><tbody><tr><th scope="row">域名</th><td>'+$('.form-control').val()+'</td></tr><tr><th scope="row">状态码</th><td>'+result.state+'</td></tr></tbody></table>');
|
||||
}else if(result.code=='0'){
|
||||
layer.msg(result.state);
|
||||
}else{
|
||||
layer.msg('失败');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -1,265 +0,0 @@
|
|||
<?php
|
||||
$id="29";
|
||||
include '../../header.php';?>
|
||||
<div class="container clearfix">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">网站状态码</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<div class="form-group">
|
||||
<label for="inputEmail3" class="col-sm-2 control-label">域名</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="form-control" placeholder="域名">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-controlss text-lefter">
|
||||
<div id="content"><?php echo $content;?></div>
|
||||
<div id="msg"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="submit" class="btn btn-default" id="btn_state">查询</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">状态码表</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>状态码</th>
|
||||
<th>状态码英文名称</th>
|
||||
<th>中文描述</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>100</td>
|
||||
<td>Continue</td>
|
||||
<td>继续.客户端应继续其请求</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>101</td>
|
||||
<td>Switching Protocols</td>
|
||||
<td>切换协议。服务器根据客户端的请求切换协议。只能切换到更高级的协议,例如,切换到HTTP的新版本协议</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>200</td>
|
||||
<td>OK</td>
|
||||
<td>请求成功。一般用于GET与POST请求</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>201</td>
|
||||
<td>Created</td>
|
||||
<td>已创建。成功请求并创建了新的资源</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>202</td>
|
||||
<td>Accepted</td>
|
||||
<td>已接受。已经接受请求,但未处理完成</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>203</td>
|
||||
<td>Non-Authoritative Information</td>
|
||||
<td>非授权信息。请求成功。但返回的meta信息不在原始的服务器,而是一个副本</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>204</td>
|
||||
<td>No Content</td>
|
||||
<td>无内容。服务器成功处理,但未返回内容。在未更新网页的情况下,可确保浏览器继续显示当前文档</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>205</td>
|
||||
<td>Reset Content</td>
|
||||
<td>重置内容。服务器处理成功,用户终端(例如:浏览器)应重置文档视图。可通过此返回码清除浏览器的表单域</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>206</td>
|
||||
<td>Partial Content</td>
|
||||
<td>部分内容。服务器成功处理了部分GET请求</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>300</td>
|
||||
<td>Multiple Choices</td>
|
||||
<td>多种选择。请求的资源可包括多个位置,相应可返回一个资源特征与地址的列表用于用户终端(例如:浏览器)选择</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>301</td>
|
||||
<td>Moved Permanently</td>
|
||||
<td>永久移动。请求的资源已被永久的移动到新URI,返回信息会包括新的URI,浏览器会自动定向到新URI。今后任何新的请求都应使用新的URI代替</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>302</td>
|
||||
<td>Found</td>
|
||||
<td>临时移动。与301类似。但资源只是临时被移动。客户端应继续使用原有URI</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>303</td>
|
||||
<td>See Other</td>
|
||||
<td>查看其它地址。与301类似。使用GET和POST请求查看</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>304</td>
|
||||
<td>Not Modified</td>
|
||||
<td>未修改。所请求的资源未修改,服务器返回此状态码时,不会返回任何资源。客户端通常会缓存访问过的资源,通过提供一个头信息指出客户端希望只返回在指定日期之后修改的资源</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>305</td>
|
||||
<td>Use Proxy</td>
|
||||
<td>使用代理。所请求的资源必须通过代理访问</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>306</td>
|
||||
<td>Unused</td>
|
||||
<td>已经被废弃的HTTP状态码</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>307</td>
|
||||
<td>Temporary Redirect</td>
|
||||
<td>临时重定向。与302类似。使用GET请求重定向</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>400</td>
|
||||
<td>Bad Request</td>
|
||||
<td>客户端请求的语法错误,服务器无法理解</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>401</td>
|
||||
<td>Unauthorized</td>
|
||||
<td>请求要求用户的身份认证</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>402</td>
|
||||
<td>Payment Required</td>
|
||||
<td>保留,将来使用</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>403</td>
|
||||
<td>Forbidden</td>
|
||||
<td>服务器理解请求客户端的请求,但是拒绝执行此请求</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>404</td>
|
||||
<td>Not Found</td>
|
||||
<td>服务器无法根据客户端的请求找到资源(网页)。通过此代码,网站设计人员可设置"您所请求的资源无法找到"的个性页面</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>405</td>
|
||||
<td>Method Not Allowed</td>
|
||||
<td>客户端请求中的方法被禁止</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>406</td>
|
||||
<td>Not Acceptable</td>
|
||||
<td>服务器无法根据客户端请求的内容特性完成请求</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>407</td>
|
||||
<td>Proxy Authentication Required</td>
|
||||
<td>请求要求代理的身份认证,与401类似,但请求者应当使用代理进行授权</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>408</td>
|
||||
<td>Request Time-out</td>
|
||||
<td>服务器等待客户端发送的请求时间过长,超时</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>409</td>
|
||||
<td>Conflict</td>
|
||||
<td>服务器完成客户端的PUT请求是可能返回此代码,服务器处理请求时发生了冲突</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>410</td>
|
||||
<td>Gone</td>
|
||||
<td>客户端请求的资源已经不存在。410不同于404,如果资源以前有现在被永久删除了可使用410代码,网站设计人员可通过301代码指定资源的新位置</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>411</td>
|
||||
<td>Length Required</td>
|
||||
<td>服务器无法处理客户端发送的不带Content-Length的请求信息</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>412</td>
|
||||
<td>Precondition Failed</td>
|
||||
<td>客户端请求信息的先决条件错误</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>413</td>
|
||||
<td>Request Entity Too Large</td>
|
||||
<td>由于请求的实体过大,服务器无法处理,因此拒绝请求。为防止客户端的连续请求,服务器可能会关闭连接。如果只是服务器暂时无法处理,则会包含一个Retry-After的响应信息</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>414</td>
|
||||
<td>Request-URI Too Large</td>
|
||||
<td>请求的URI过长(URI通常为网址),服务器无法处理</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>415</td>
|
||||
<td>Unsupported Media Type</td>
|
||||
<td>服务器无法处理请求附带的媒体格式</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>416</td>
|
||||
<td>Requested range not satisfiable</td>
|
||||
<td>客户端请求的范围无效</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>417</td>
|
||||
<td>Expectation Failed</td>
|
||||
<td>服务器无法满足Expect的请求头信息</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>500</td>
|
||||
<td>Internal Server Error</td>
|
||||
<td>服务器内部错误,无法完成请求</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>501</td>
|
||||
<td>Not Implemented</td>
|
||||
<td>服务器不支持请求的功能,无法完成请求</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>502</td>
|
||||
<td>Bad Gateway</td>
|
||||
<td>充当网关或代理的服务器,从远端服务器接收到了一个无效的请求</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>503</td>
|
||||
<td>Service Unavailable</td>
|
||||
<td>由于超载或系统维护,服务器暂时的无法处理客户端的请求。延时的长度可包含在服务器的Retry-After头信息中</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>504</td>
|
||||
<td>Gateway Time-out</td>
|
||||
<td>充当网关或代理的服务器,未及时从远端服务器获取请求</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>505</td>
|
||||
<td>HTTP Version not supported</td>
|
||||
<td>服务器不支持请求的HTTP协议的版本,无法完成处理</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="StatusCode.php"></script>
|
||||
<?php include '../../footer.php';?>
|
Before Width: | Height: | Size: 745 B |
Before Width: | Height: | Size: 19 KiB |
|
@ -1,2 +0,0 @@
|
|||
<?php
|
||||
echoJson(shortUrl(getParam('longUrl','https://aptx4869.tech/lmbtfy/')));function shortUrl($i){$j="http://api.weibo.com/2/short_url/shorten.json?source=2849184197&url_long=".urlencode($i);$k=curl_init($j);curl_setopt($k,CURLOPT_RETURNTRANSFER,1);curl_setopt($k,CURLOPT_HEADER,0);curl_setopt($k,CURLOPT_ENCODING,"");$l=curl_exec($k);curl_close($k);return $l;}function getParam($m,$n=''){return trim($m&&is_string($m)?isset($_POST[$m])?$_POST[$m]:(isset($_GET[$m])?$_GET[$m]:$n):$n);}function echoJson($o){$p=getParam('callback');if($p!=''){die($p.'('.$o.')');}else{die($o);}}
|
|
@ -1,42 +0,0 @@
|
|||
<?php
|
||||
$id="20";
|
||||
include '../../header.php';?>
|
||||
<link href="style.css" rel="stylesheet" type="text/css">
|
||||
<style>
|
||||
/*针对排版做的一点调整*/
|
||||
.title img{vertical-align:0;}
|
||||
h1{margin:20px !important;}
|
||||
</style>
|
||||
<img src="arrow.png" id="arrow">
|
||||
<div class="about" title="点我点我!" onclick="showAbout()">?</div>
|
||||
<div id="msgbox" class="pop-box">
|
||||
<span class="caption">专治各种疑问党</span>
|
||||
<div class="thanks copyBaidu">
|
||||
*本站与百度公司没有任何联系,baidu以及本站出现的百度公司Logo是百度公司的商标。
|
||||
</div>
|
||||
<div class="readit" onclick="hideAbout();">我知道了</div>
|
||||
|
||||
</div>
|
||||
<div id="mask" class="mask"></div>
|
||||
|
||||
<div class="containerss">
|
||||
<div>
|
||||
<h1 class="title">需要我帮你<img src="baidu_logo.png" class="baidulogo">么</h1>
|
||||
<span class="search-box">
|
||||
<input type="text" class="search-text" id="kw">
|
||||
<button class="btn" id="search">百度一下</button>
|
||||
</span>
|
||||
</div>
|
||||
<div id="instructions">
|
||||
输入你的问题,然后按百度一下
|
||||
</div>
|
||||
<div class="link" style="display: none" id="link">
|
||||
<input type="text" id="lmbtfyLink" class="copyable">
|
||||
<div>
|
||||
<a class="link_button" href="javascript:copyUrl2();" id="copy">复制</a>
|
||||
<a class="link_button" href="javascript:void(0);" id="go" target="_blank">预览</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="lmbtfy.php"></script>
|
||||
<?php include '../../footer.php';?>
|
|
@ -1,114 +0,0 @@
|
|||
/**
|
||||
* @act 百度一下
|
||||
* @version 1.0
|
||||
* @author youngxj
|
||||
* @date 2018-03-24
|
||||
* @url http://www.youngxj.cn
|
||||
*/
|
||||
|
||||
|
||||
function urlEncode(String) {
|
||||
return encodeURIComponent(String).replace(/'/g,"%27").replace(/"/g,"%22");
|
||||
}
|
||||
|
||||
$(document).ready(function (){
|
||||
$('#search').on('click', function (){
|
||||
if($('#kw').val() == ''){layer.alert('请填写内容!');return false;}
|
||||
var link = window.location.origin + window.location.pathname + '?' + urlEncode($('#kw').val());
|
||||
$.ajax({
|
||||
url: 'get.php?longUrl='+link,
|
||||
type: "GET",
|
||||
dataType: "jsonp", //使用JSONP方法进行AJAX
|
||||
cache: false,
|
||||
success: function (data) {
|
||||
if (data){
|
||||
if(!(typeof data.urls === undefined || typeof data.urls == "undefined")) //防止短网址失败
|
||||
{
|
||||
link = data.urls[0].url_short;
|
||||
}
|
||||
}
|
||||
$('#go').attr("href",link);
|
||||
$('#link').show();
|
||||
$('#instructions').text('复制下面的地址,然后发给伸手党吧!');
|
||||
$('#lmbtfyLink').val(link).focus().select();
|
||||
}
|
||||
})
|
||||
});
|
||||
var $container = $('.container');
|
||||
$container.on('click', '#go', function (){ //点击预览
|
||||
var link = $('#lmbtfyLink').val();
|
||||
if (!!link){
|
||||
//window.open(link); //新窗口打开
|
||||
//window.location = link;
|
||||
}
|
||||
});
|
||||
var $kw = $('#kw');
|
||||
$kw.on('keydown', function (e) {
|
||||
if (e.keyCode == 13){
|
||||
$('#search').trigger('click');
|
||||
}
|
||||
});
|
||||
if (!!window.location.search){
|
||||
var kw = decodeURIComponent(window.location.search.substr(1));
|
||||
var $instructions = $('#instructions');
|
||||
var $arrow = $('#arrow');
|
||||
setTimeout(function (){
|
||||
$instructions.text('1、找到输入框并选中');
|
||||
$arrow.show().animate({
|
||||
left: $kw.offset().left + 10 + 'px',
|
||||
top: ($kw.offset().top + $kw.height()/2) + 'px'
|
||||
}, 2000, function (){
|
||||
$instructions.text('2、输入你的问题');
|
||||
$arrow.hide();
|
||||
var $kw = $('#kw');
|
||||
$kw.focus();
|
||||
var i = 0;
|
||||
var interval = setInterval(function (){
|
||||
$kw.val(kw.substr(0,i));
|
||||
i++;
|
||||
if (i > kw.length){
|
||||
clearInterval(interval);
|
||||
$instructions.text('3、按下“百度一下”按钮');
|
||||
$arrow.show();
|
||||
var $search = $('#search');
|
||||
$arrow.animate({
|
||||
left: $search.offset().left + $search.width()/2 + 'px',
|
||||
top: $search.offset().top + $search.height()/2 + 'px'
|
||||
}, 1000, function () {
|
||||
$instructions.html('<strong>这对你而言就是这么困难么?</strong>');
|
||||
setTimeout(function (){
|
||||
window.location = 'http://www.baidu.com/s?ch=3&ie=utf-8&wd=' + encodeURIComponent(kw);
|
||||
}, 2000);
|
||||
})
|
||||
}
|
||||
}, 200);
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function showAbout() //弹出消息
|
||||
{
|
||||
var windowWidth = $(window).width();
|
||||
var windowHeight = $(window).height();
|
||||
|
||||
var popupHeight = $("#msgbox").height();
|
||||
var popupWidth = $("#msgbox").width();
|
||||
//添加并显示遮罩层
|
||||
$("#mask").width(windowWidth).height(windowHeight).click(function() {hideAbout(); }).fadeIn(200);
|
||||
$("#msgbox").css({"position": "absolute","left":windowWidth/2-popupWidth/2,"top":windowHeight/2-popupHeight/2}).fadeIn(200);
|
||||
}
|
||||
|
||||
function hideAbout() //隐藏弹出的提示框
|
||||
{
|
||||
$("#mask").fadeOut(200);
|
||||
$("#msgbox").fadeOut(200);
|
||||
}
|
||||
|
||||
function copyUrl2(){
|
||||
var urlresult=document.getElementById("lmbtfyLink");
|
||||
urlresult.select(); // 选择对象
|
||||
document.execCommand("Copy"); // 执行浏览器复制命令
|
||||
alert("已复制好,可贴粘。");
|
||||
}
|
|
@ -1,251 +0,0 @@
|
|||
*{
|
||||
font-family: "Helvetica Neue", Helvetica, Microsoft Yahei, Hiragino Sans GB, WenQuanYi Micro Hei, sans-serif;
|
||||
}
|
||||
|
||||
/*关于 按钮*/
|
||||
.about{
|
||||
position: absolute;
|
||||
top: 5em;
|
||||
right: 1em;
|
||||
height: 1.5em;
|
||||
line-height: 1.5em;
|
||||
width: 1.5em;
|
||||
border-radius: .75em;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
background-color: #363636;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*弹窗层*/
|
||||
|
||||
.pop-box {
|
||||
z-index: 9999; /*这个数值要足够大,才能够显示在最上层*/
|
||||
margin-bottom: 2px;
|
||||
display: none;
|
||||
position: fixed;
|
||||
background: #FFF;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
width: 300px;
|
||||
}
|
||||
.pop-box .caption{
|
||||
font-size: 23px;
|
||||
display: block;
|
||||
text-align: left;
|
||||
border-left: 4px solid #563d7c;
|
||||
margin: 10px 0 10px 5px;
|
||||
background: #eee;
|
||||
padding: 3px;
|
||||
color: #666;
|
||||
}
|
||||
.pop-box .thanks{
|
||||
/*text-indent: 30px;*/
|
||||
padding: 0 10px;
|
||||
text-align: left;
|
||||
line-height: 25px;
|
||||
color: #555;
|
||||
}
|
||||
.pop-box .copyBaidu{
|
||||
font-size: 12px;
|
||||
/*text-indent: 30px;*/
|
||||
padding: 0 10px;
|
||||
text-align: left;
|
||||
line-height: 18px;
|
||||
color: #999;
|
||||
}
|
||||
.pop-box .thanks a{
|
||||
margin: 0 2px;
|
||||
color: #666;
|
||||
text-decoration: none;
|
||||
}
|
||||
.pop-box .thanks a:hover{
|
||||
margin: 0 2px;
|
||||
color: #666;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.pop-box .readit{ /* “我知道了” */
|
||||
font-size: 14px;
|
||||
line-height: 40px;
|
||||
cursor: pointer;
|
||||
transition: all 0.5s ease;
|
||||
-webkit-transition: all 0.5s ease;
|
||||
-moz-transition: all 0.5s ease;
|
||||
-o-transition: all 0.5s ease;
|
||||
-ms-transition: all 0.5s ease;
|
||||
}
|
||||
.pop-box .readit:hover{ /* “我知道了” */
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.mask { /*遮罩层*/
|
||||
color:#C7EDCC;
|
||||
background-color:#000;
|
||||
position:absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
opacity: 0.59;
|
||||
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity = 59);
|
||||
filter: alpha(opacity = 59);
|
||||
}
|
||||
|
||||
/*页面主体部分*/
|
||||
.containerss{
|
||||
height: 500px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
.title{
|
||||
padding-top: 100px;
|
||||
}
|
||||
#kw {
|
||||
width: 521px;
|
||||
height: 40px;
|
||||
padding: 9px 7px;
|
||||
font: 16px arial;
|
||||
border: 1px solid #d8d8d8;
|
||||
border-bottom: 1px solid #ccc;
|
||||
vertical-align: top;
|
||||
outline: none;
|
||||
margin-right: 0;
|
||||
}
|
||||
#kw:focus{
|
||||
border-top: 1px solid #38f !important;
|
||||
border-left: 1px solid #38f !important;
|
||||
border-bottom: 1px solid #38f !important;
|
||||
}
|
||||
/*百度一下*/
|
||||
.search-box .btn {
|
||||
cursor: pointer;
|
||||
width: 102px;
|
||||
height: 40px;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
background-color: #38f;
|
||||
font-size: 16px;
|
||||
color: white;
|
||||
margin-left: -10px;
|
||||
}
|
||||
.baidulogo {
|
||||
height: 100px;
|
||||
margin-bottom: -20px;
|
||||
}
|
||||
#instructions { /*提示语*/
|
||||
display: inline-block;
|
||||
margin-top: 40px;
|
||||
padding: 30px 2px;
|
||||
color: #999999;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
.link {
|
||||
/*margin-top: 100px;*/
|
||||
display: block;
|
||||
}
|
||||
a.link_button {
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
height: 35px;
|
||||
line-height: 38px;
|
||||
margin: 0 10px;
|
||||
background-color: #38f;
|
||||
color: white;
|
||||
text-align: center;
|
||||
font-size: 0.8em;
|
||||
text-decoration: none;
|
||||
}
|
||||
/*链接框*/
|
||||
.copyable{
|
||||
width: 300px;
|
||||
height: 30px;
|
||||
font-size: 25px;
|
||||
margin-bottom: 20px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
#arrow{
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
footer{
|
||||
color: gray;
|
||||
text-align: center;
|
||||
}
|
||||
footer a{
|
||||
color: gray;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 666px) { /*针对小屏幕的优化*/
|
||||
|
||||
.title{
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
padding-top: 100px;
|
||||
}
|
||||
|
||||
.logo {
|
||||
height: 50px;
|
||||
margin-bottom: -8px;
|
||||
}
|
||||
|
||||
.search-box{
|
||||
padding-top: 10px;
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#kw {
|
||||
height: 40px;
|
||||
font: 16px arial;
|
||||
border: 1px solid #d8d8d8;
|
||||
border-bottom: 1px solid #ccc;
|
||||
vertical-align: top;
|
||||
outline: none;
|
||||
|
||||
float:left;
|
||||
width: 85%;
|
||||
margin-right: -200px;
|
||||
}
|
||||
|
||||
/*百度一下*/
|
||||
.btn {
|
||||
height: 40px;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
background-color: #38f;
|
||||
font-size: 16px;
|
||||
color: white;
|
||||
margin-left: -10px;
|
||||
float: right;
|
||||
width: 100px;
|
||||
z-index: 999999;
|
||||
}
|
||||
|
||||
.link{
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
a.link_button {
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
height: 35px;
|
||||
line-height: 38px;
|
||||
margin: 0 10px;
|
||||
background-color: #38f;
|
||||
color: white;
|
||||
text-align: center;
|
||||
font-size: 0.8em;
|
||||
text-decoration: none;
|
||||
}
|
||||
/*链接框*/
|
||||
.copyable{
|
||||
width: 80%;
|
||||
height: 30px;
|
||||
font-size: 20px;
|
||||
margin-bottom: 20px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
|
@ -1,162 +0,0 @@
|
|||
/**
|
||||
* @act code
|
||||
* @version 1.0
|
||||
* @author youngxj
|
||||
* @date 2018-03-24
|
||||
* @url http://www.youngxj.cn
|
||||
*/
|
||||
|
||||
control('请输入内容:');
|
||||
function urlencode(){
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.getJSON("https://api.yum6.cn/code/code.php?urlencode="+$('.form-control').val(),function(data){
|
||||
if (data.code=="200") {
|
||||
$("#form-control").text(data.value);
|
||||
$(".form-controls").show();
|
||||
}else{
|
||||
layer.msg('失败,请重试!');
|
||||
}
|
||||
});
|
||||
}
|
||||
function urldecode(){
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.getJSON("https://api.yum6.cn/code/code.php?urldecode="+$('.form-control').val(),function(data){
|
||||
if (data.code=="200") {
|
||||
$("#form-control").text(data.value);
|
||||
$(".form-controls").show();
|
||||
}else{
|
||||
layer.msg('失败,请重试!');
|
||||
}
|
||||
});
|
||||
}
|
||||
function base64_encode(){
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.getJSON("https://api.yum6.cn/code/code.php?base64_encode="+$('.form-control').val(),function(data){
|
||||
if (data.code=="200") {
|
||||
$("#form-control").text(data.value);
|
||||
$(".form-controls").show();
|
||||
}else{
|
||||
layer.msg('失败,请重试!');
|
||||
}
|
||||
});
|
||||
}
|
||||
function base64_decode(){
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.getJSON("https://api.yum6.cn/code/code.php?base64_decode="+$('.form-control').val(),function(data){
|
||||
if (data.code=="200") {
|
||||
$("#form-control").text(data.value);
|
||||
$(".form-controls").show();
|
||||
}else{
|
||||
layer.msg('失败,请重试!');
|
||||
}
|
||||
});
|
||||
}
|
||||
function md5(){
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.getJSON("https://api.yum6.cn/code/code.php?md5="+$('.form-control').val(),function(data){
|
||||
if (data.code=="200") {
|
||||
$("#form-control").text(data.value);
|
||||
$(".form-controls").show();
|
||||
}else{
|
||||
layer.msg('失败,请重试!');
|
||||
}
|
||||
});
|
||||
}
|
||||
function addslashes(){
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.getJSON("https://api.yum6.cn/code/code.php?addslashes="+$('.form-control').val(),function(data){
|
||||
if (data.code=="200") {
|
||||
$("#form-control").text(data.value);
|
||||
$(".form-controls").show();
|
||||
}else{
|
||||
layer.msg('失败,请重试!');
|
||||
}
|
||||
});
|
||||
}
|
||||
function stripslashes(){
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.getJSON("https://api.yum6.cn/code/code.php?stripslashes="+$('.form-control').val(),function(data){
|
||||
if (data.code=="200") {
|
||||
$("#form-control").text(data.value);
|
||||
$(".form-controls").show();
|
||||
}else{
|
||||
layer.msg('失败,请重试!');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function base64_image_mult() {
|
||||
$('#form1').show();
|
||||
}
|
||||
|
||||
function base64_image_url() {
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.getJSON("https://api.yum6.cn/code/code.php?base64_image&img="+$('.form-control').val(),function(data){
|
||||
if (data.code=="200") {
|
||||
var base64_url_img = "<img src='"+data.base64_image+"' width='"+data.width+"' height='"+data.height+"'>";
|
||||
$(".form-controls").show();
|
||||
$(".form-controls").html('<img src="'+data.base64_image+'" width="100%"><br/><label class="control-label" for="inputContent">data url:</label><textarea class="form-control" rows="5" onclick="oCopy(this)" id="form-control">'+data.base64_image+'</textarea><label class="control-label" for="inputContent">css:</label><textarea class="form-control" rows="5" onclick="oCopy(this)" id="form-control">'+base64_url_img+'</textarea>');
|
||||
$('#stat').html('上传完毕!');
|
||||
}else{
|
||||
layer.msg('失败,请重试!');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function onprogress(evt){
|
||||
var loaded = evt.loaded; //已经上传大小情况
|
||||
var tot = evt.total; //附件总大小
|
||||
var per = Math.floor(100*loaded/tot); //已经上传的百分比
|
||||
layer.msg(per+'%', {
|
||||
icon: 16
|
||||
,shade: 0.01
|
||||
});
|
||||
}
|
||||
|
||||
function sc(){
|
||||
var animateimg = $("#file").val(); //获取上传的图片名 带//
|
||||
var imgarr=animateimg.split('\\'); //分割
|
||||
var myimg=imgarr[imgarr.length-1]; //去掉 // 获取图片名
|
||||
var houzui = myimg.lastIndexOf('.'); //获取 . 出现的位置
|
||||
var ext = myimg.substring(houzui, myimg.length).toUpperCase(); //切割 . 获取文件后缀
|
||||
var file = $('#file').get(0).files[0]; //获取上传的文件
|
||||
var fileSize = file.size; //获取上传的文件大小
|
||||
var maxSize = 10485760; //最大10MB(字节)
|
||||
if(ext !='.PNG' && ext !='.GIF' && ext !='.JPG' && ext !='.JPEG' && ext !='.BMP'){
|
||||
layer.msg('文件类型错误,请上传图片类型');
|
||||
return false;
|
||||
}else if(parseInt(fileSize) >= parseInt(maxSize)){
|
||||
layer.msg('上传的文件不能超过10MB');
|
||||
return false;
|
||||
}else{
|
||||
$('#stat').html('正在上传');
|
||||
var data = new FormData($('#form1')[0]);
|
||||
$.ajax({
|
||||
url: "https://api.yum6.cn/code/code.php?base64_image&type=multipart",
|
||||
type: 'POST',
|
||||
data: data,
|
||||
dataType: 'JSON',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
xhr: function(){
|
||||
var xhr = $.ajaxSettings.xhr();
|
||||
if(onprogress && xhr.upload) {
|
||||
xhr.upload.addEventListener("progress" , onprogress, false);
|
||||
return xhr;
|
||||
}
|
||||
}
|
||||
}).done(function(ret){
|
||||
if(ret['code']=='200'){
|
||||
var base64_url_img = "<img src='"+ret.base64_image+"' width='"+ret.width+"' height='"+ret.height+"'>";
|
||||
$(".form-controls").show();
|
||||
$(".form-controls").html('<img src="'+ret.base64_image+'" width="100%"><br/><label class="control-label" for="inputContent">data url:</label><textarea class="form-control" rows="5" onclick="oCopy(this)" id="form-control">'+ret.base64_image+'</textarea><label class="control-label" for="inputContent">css:</label><textarea class="form-control" rows="5" onclick="oCopy(this)" id="form-control">'+base64_url_img+'</textarea>');
|
||||
$('#stat').html('上传完毕!');
|
||||
layer.msg('上传完毕!');
|
||||
}else{
|
||||
layer.msg('上传失败');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
};
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
<?php
|
||||
$id="1";
|
||||
include '../../header.php';?>
|
||||
<div class="container clearfix">
|
||||
<div class="row row-xs">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-10 col-xs-offset-1 col-sm-offset-3 col-md-offset-3 col-lg-offset-3">
|
||||
<div class="page-header">
|
||||
<h3 class="text-center h3-xs"><?php echo $title;?><small class="text-capitalize"><?php echo $subtitle;?></small></h3>
|
||||
</div>
|
||||
<h5 class="text-right"><small><?php echo $explains;?></small></h5>
|
||||
<div class="form-group" id="input-wrap">
|
||||
<label class="control-label control-msg" for="inputContent" copy="Youngxj|杨小杰,admin@youngxj.com"></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" aria-label="...">
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">启动<span class="caret"></span></button>
|
||||
<ul class="dropdown-menu dropdown-menu-right">
|
||||
<li><a href="javascript:urlencode()">urlencode</a></li>
|
||||
<li><a href="javascript:urldecode()">urldecode</a></li>
|
||||
<li><a href="javascript:base64_encode()">base64_encode</a></li>
|
||||
<li><a href="javascript:base64_decode()">base64_decode</a></li>
|
||||
<li><a href="javascript:md5()">md5</a></li>
|
||||
<li><a href="javascript:addslashes()">addslashes</a></li>
|
||||
<li><a href="javascript:stripslashes()">stripslashes</a></li>
|
||||
<li><a href="javascript:base64_image_mult()">base64_image_mult</a></li>
|
||||
<li><a href="javascript:base64_image_url()">base64_image_url</a></li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li class="disabled"><a href="http://www.youngxj.cn">©Youngxj</a></li>
|
||||
</ul>
|
||||
</div><!-- /btn-group -->
|
||||
</div><!-- /input-group -->
|
||||
<small><code>如果没有报错但是不返回内容就需要注意字符编码问题(目前工具编码为UTF-8)</code></small>
|
||||
</div><!-- /.col-lg-6 -->
|
||||
<div class="form-controls">
|
||||
<label class="control-label" for="inputContent">返回的内容:</label>
|
||||
<textarea class="form-control" rows="10" onclick="oCopy(this)" id="form-control" placeholder="如果没有报错但是不返回内容就需要注意字符编码问题"></textarea>
|
||||
</div>
|
||||
<form id="form1">
|
||||
<div class="upload-drag" id="upload-drag" onclick="file.click()" title="点击上传图片">
|
||||
<img src="https://ww2.sinaimg.cn/large/843dc74bgy1fpkedpgq3tj201c01c0of.jpg">
|
||||
<p id="stat">点击上传</p>
|
||||
<input type="file" id="file" name="file" onchange="sc();" style="display:none" accept="image/*">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="code.php"></script>
|
||||
<?php include '../../footer.php';?>
|
|
@ -1,40 +0,0 @@
|
|||
/**
|
||||
* @act 猜数
|
||||
* @version 1.0
|
||||
* @author youngxj
|
||||
* @date 2018-03-24
|
||||
* @url http://www.youngxj.cn
|
||||
*/
|
||||
|
||||
var s=parseInt(Math.random()*100);
|
||||
var x=0;
|
||||
function fun(){
|
||||
if($('#sz').val()==''){
|
||||
layer.alert('你是不是忘记填内容了?');
|
||||
}else{
|
||||
var user=document.getElementById("sz").value;
|
||||
x=x+1;
|
||||
document.getElementById("test").value = x;
|
||||
if(user>s){
|
||||
document.getElementById("jg").value = "你猜大了!";
|
||||
}
|
||||
else if(user<s){
|
||||
document.getElementById("jg").value = "你猜小了!";
|
||||
}
|
||||
else if(user==s){
|
||||
document.getElementById("jg").value = "你猜对了!";
|
||||
if(x<2){alert("你运气不错,答对了!");}
|
||||
else if (x<5) {
|
||||
layer.alert("你真聪明用了,只用了"+x+"次就答出来了!");
|
||||
}else if(x<10){
|
||||
layer.alert("智力中等偏上,只用了"+x+"次就答出来了!");
|
||||
}else if(x<15){
|
||||
layer.alert("你的智商有待充值,用了"+x+"次才答出来!");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
function cx(){
|
||||
history.go(0);
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
<?php
|
||||
$id="17";
|
||||
include '../../header.php';?>
|
||||
<div class="container clearfix">
|
||||
<div class="row row-xs">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-10 col-xs-offset-1 col-sm-offset-3 col-md-offset-3 col-lg-offset-3">
|
||||
<div class="page-header">
|
||||
<h3 class="text-center h3-xs"><?php echo $title;?><small class="text-capitalize"><?php echo $subtitle;?></small></h3>
|
||||
</div>
|
||||
<h5 class="text-right"><small><?php echo $explains;?></small></h5>
|
||||
<div class="form-group" id="input-wrap">
|
||||
<label class="control-label control-msg" for="inputContent" copy="Youngxj|杨小杰,admin@youngxj.com"></label>
|
||||
<div class="input">
|
||||
答题内容:<input type="number" class="form-control" id="sz" ><br>
|
||||
答题次数:<input type="text" class="form-control" id="test" readonly='readonly'><br>
|
||||
答题结果:<input type="text" class="form-control" id="jg" readonly='readonly' ><br><br>
|
||||
<input type="button" class="btn btn-primary col-xs-6" value="我猜" id=tj onclick="fun();">
|
||||
<input type="button" class="btn btn-primary col-xs-6" value="重置" id="cz" onclick="cx();">
|
||||
</div><!-- /input-group -->
|
||||
</div><!-- /.col-lg-6 -->
|
||||
<div class="form-controlss text-center">
|
||||
<div id="content"></div>
|
||||
<div id="msg"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="cs.php"></script>
|
||||
<?php include '../../footer.php';
|
|
@ -1,172 +0,0 @@
|
|||
.CodeMirror {
|
||||
line-height: 1em;
|
||||
font-family: monospace;
|
||||
|
||||
/* Necessary so the scrollbar can be absolutely positioned within the wrapper on Lion. */
|
||||
position: relative;
|
||||
/* This prevents unwanted scrollbars from showing up on the body and wrapper in IE. */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.CodeMirror-scroll {
|
||||
overflow: auto;
|
||||
height: 300px;
|
||||
/* This is needed to prevent an IE[67] bug where the scrolled content
|
||||
is visible outside of the scrolling box. */
|
||||
position: relative;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* Vertical scrollbar */
|
||||
.CodeMirror-scrollbar {
|
||||
position: absolute;
|
||||
right: 0; top: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
z-index: 5;
|
||||
}
|
||||
.CodeMirror-scrollbar-inner {
|
||||
/* This needs to have a nonzero width in order for the scrollbar to appear
|
||||
in Firefox and IE9. */
|
||||
width: 1px;
|
||||
}
|
||||
.CodeMirror-scrollbar.cm-sb-overlap {
|
||||
/* Ensure that the scrollbar appears in Lion, and that it overlaps the content
|
||||
rather than sitting to the right of it. */
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
float: none;
|
||||
right: 0;
|
||||
min-width: 12px;
|
||||
}
|
||||
.CodeMirror-scrollbar.cm-sb-nonoverlap {
|
||||
min-width: 12px;
|
||||
}
|
||||
.CodeMirror-scrollbar.cm-sb-ie7 {
|
||||
min-width: 18px;
|
||||
}
|
||||
|
||||
.CodeMirror-gutter {
|
||||
position: absolute; left: 0; top: 0;
|
||||
z-index: 10;
|
||||
background-color: #f7f7f7;
|
||||
border-right: 1px solid #eee;
|
||||
min-width: 2em;
|
||||
height: 100%;
|
||||
}
|
||||
.CodeMirror-gutter-text {
|
||||
color: #aaa;
|
||||
text-align: right;
|
||||
padding: .4em .2em .4em .4em;
|
||||
white-space: pre !important;
|
||||
cursor: default;
|
||||
}
|
||||
.CodeMirror-lines {
|
||||
padding: .4em;
|
||||
white-space: pre;
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
.CodeMirror pre {
|
||||
-moz-border-radius: 0;
|
||||
-webkit-border-radius: 0;
|
||||
-o-border-radius: 0;
|
||||
border-radius: 0;
|
||||
border-width: 0; margin: 0; padding: 0; background: transparent;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
padding: 0; margin: 0;
|
||||
white-space: pre;
|
||||
word-wrap: normal;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.CodeMirror-wrap pre {
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
word-break: normal;
|
||||
}
|
||||
.CodeMirror-wrap .CodeMirror-scroll {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.CodeMirror textarea {
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
.CodeMirror pre.CodeMirror-cursor {
|
||||
z-index: 10;
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
border-left: 1px solid black;
|
||||
border-right: none;
|
||||
}
|
||||
.cm-keymap-fat-cursor pre.CodeMirror-cursor {
|
||||
width: auto;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
background: rgba(0, 200, 0, .4);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
|
||||
}
|
||||
/* Kludge to turn off filter in ie9+, which also accepts rgba */
|
||||
.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) {
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
||||
}
|
||||
.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}
|
||||
.CodeMirror-focused pre.CodeMirror-cursor {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
div.CodeMirror-selected { background: #d9d9d9; }
|
||||
.CodeMirror-focused div.CodeMirror-selected { background: #d7d4f0; }
|
||||
|
||||
.CodeMirror-searching {
|
||||
background: #ffa;
|
||||
background: rgba(255, 255, 0, .4);
|
||||
}
|
||||
|
||||
/* Default theme */
|
||||
|
||||
.cm-s-default span.cm-keyword {color: #708;}
|
||||
.cm-s-default span.cm-atom {color: #219;}
|
||||
.cm-s-default span.cm-number {color: #164;}
|
||||
.cm-s-default span.cm-def {color: #00f;}
|
||||
.cm-s-default span.cm-variable {color: black;}
|
||||
.cm-s-default span.cm-variable-2 {color: #05a;}
|
||||
.cm-s-default span.cm-variable-3 {color: #085;}
|
||||
.cm-s-default span.cm-property {color: black;}
|
||||
.cm-s-default span.cm-operator {color: black;}
|
||||
.cm-s-default span.cm-comment {color: #a50;}
|
||||
.cm-s-default span.cm-string {color: #a11;}
|
||||
.cm-s-default span.cm-string-2 {color: #f50;}
|
||||
.cm-s-default span.cm-meta {color: #555;}
|
||||
.cm-s-default span.cm-error {color: #f00;}
|
||||
.cm-s-default span.cm-qualifier {color: #555;}
|
||||
.cm-s-default span.cm-builtin {color: #30a;}
|
||||
.cm-s-default span.cm-bracket {color: #997;}
|
||||
.cm-s-default span.cm-tag {color: #170;}
|
||||
.cm-s-default span.cm-attribute {color: #00c;}
|
||||
.cm-s-default span.cm-header {color: blue;}
|
||||
.cm-s-default span.cm-quote {color: #090;}
|
||||
.cm-s-default span.cm-hr {color: #999;}
|
||||
.cm-s-default span.cm-link {color: #00c;}
|
||||
|
||||
span.cm-header, span.cm-strong {font-weight: bold;}
|
||||
span.cm-em {font-style: italic;}
|
||||
span.cm-emstrong {font-style: italic; font-weight: bold;}
|
||||
span.cm-link {text-decoration: underline;}
|
||||
|
||||
span.cm-invalidchar {color: #f00;}
|
||||
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
||||
|
||||
@media print {
|
||||
|
||||
/* Hide the cursor when printing */
|
||||
.CodeMirror pre.CodeMirror-cursor {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,101 +0,0 @@
|
|||
|
||||
p {
|
||||
font-size: 13px;
|
||||
font-weight: normal;
|
||||
line-height: 18px;
|
||||
margin-bottom: 9px;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-bottom: 18px;
|
||||
font-size: 30px;
|
||||
line-height: 36px;
|
||||
font-weight: bold;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
h1 small {
|
||||
font-size: 18px;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
h3 {
|
||||
color: #555;
|
||||
}
|
||||
|
||||
textarea {
|
||||
font-family: Inconsolata, Monaco, Consolas, "Lucida Console", monospace;
|
||||
font-size: 14px;
|
||||
color: #555;
|
||||
width: 340px;
|
||||
padding: 7px;
|
||||
-webkit-appearance: none;
|
||||
outline: 0;
|
||||
border: 1px solid #bbb;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.container .raw textarea {
|
||||
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
|
||||
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
|
||||
-moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
|
||||
transition: border linear 0.25s, box-shadow linear 0.25s;
|
||||
-webkit-transition: border linear 0.25s, box-shadow linear 0.25s;
|
||||
-moz-transition: border linear 0.25s, box-shadow linear 0.25s;
|
||||
-o-transition: border linear 0.25s, box-shadow linear 0.25s;
|
||||
}
|
||||
|
||||
.container .raw textarea:focus {
|
||||
border-color: rgba(60, 200, 1, 0.8);
|
||||
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(60, 200, 1, 0.4);
|
||||
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(60, 200, 1, 0.4);
|
||||
-moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(60, 200, 1, 0.4);
|
||||
}
|
||||
|
||||
.container .formatted {
|
||||
width: 380px;
|
||||
display: inline;
|
||||
float: left;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.container .formatted textarea {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.container .options {
|
||||
width: 140px;
|
||||
display: inline;
|
||||
float: left;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.container .options input {
|
||||
margin: 5px 5px 5px 0px;
|
||||
}
|
||||
|
||||
.container .options input[type=radio] {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: 25px;
|
||||
color: #555;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.CodeMirror {
|
||||
padding: 0;
|
||||
border: 1px solid #bbb;
|
||||
}
|
||||
|
||||
.CodeMirror-scroll {
|
||||
height: 400px;
|
||||
}
|
|
@ -1,90 +0,0 @@
|
|||
<?php
|
||||
$id="28";
|
||||
include '../../header.php';
|
||||
$string = <<<html
|
||||
/* 美化:格式化代码,使之容易阅读 */
|
||||
/* 净化:将代码单行化,并去除注释 */
|
||||
/* 整理:按照一定的顺序,重新排列css的属性 */
|
||||
/* 优化:将css的长属性值优化为简写的形式 */
|
||||
/* 压缩:将代码最小化,加快加载速度 */
|
||||
|
||||
/* 如果有用,请别忘了推荐给你的朋友: */
|
||||
/* css在线美化、压缩:https://tools.yum6.cn/css_Format */
|
||||
/* v1.1 2018-04-25 完成css代码整理功能 */
|
||||
/* v1.1 2018-04-25 完成css代码压缩功能 */
|
||||
|
||||
body {
|
||||
font-family: "HanHei SC","PingHei","PingFang SC","微软雅黑","Helvetica Neue","Helvetica","Arial",sans-serif;
|
||||
font-size: 13px;
|
||||
line-height: 1.846;
|
||||
color: #666666;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
html;
|
||||
?>
|
||||
<script src="js/codemirror.js" charset="utf-8"></script>
|
||||
<script src="js/css.js" charset="utf-8"></script>
|
||||
<link rel="stylesheet" type="text/css" href="css/codemirror.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/style.css">
|
||||
<script src="js/cssbeautify.js" charset="utf-8"></script>
|
||||
<script src="js/format.js" charset="utf-8"></script>
|
||||
<div class="container clearfix" >
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="form-inline">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div style="min-height:34px;">
|
||||
<span>缩进:</span>
|
||||
<label><input checked="" type="radio" name="indent" id="fourspaces" value="fourspaces" onchange="format()">4空格</label>
|
||||
<label><input type="radio" name="indent" id="twospaces" value="twospaces" onchange="format()">2空格</label>
|
||||
<label><input type="radio" name="indent" id="tab" value="tab" onchange="format()">Tab空格</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 text-right">
|
||||
<button type="button" class="btn btn-success" onclick="clear_code()" id="clear" title="建议先整理后压缩,避免存在一些编写上的问题"><span class="glyphicon glyphicon-send"></span> 压缩</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body CodeMirror CodeMirror-wrap" style="height:400px;">
|
||||
<textarea id="raw" rows="22" autofocus="autofocus" spellcheck="false" onchange="format()" onkeydown="format()" style="display: none;"><?php if(!isset($string)||$string==''){?><?php }else{echo $string;} ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="form-inline">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div style="min-height:34px;">
|
||||
<span>打开大括号:</span>
|
||||
<label><input checked="" type="radio" name="openbrace" id="openbrace-end-of-line" onchange="format()">大括号同行</label>
|
||||
<label><input type="radio" name="openbrace" id="openbrace-separate-line" onchange="format()">大括号独行</label>
|
||||
<label><input checked="" type="checkbox" name="autosemicolon" id="autosemicolon" onchange="format()">自动分号</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body CodeMirror CodeMirror-wrap" style="height:400px;">
|
||||
<textarea id="beautified" rows="22" readonly="" style="display: none;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function clear_code(){
|
||||
if(editor.getValue()==''){layer.alert('是不是忘记填写内容了');return false;}
|
||||
var txt = editor.getValue();
|
||||
$.post("https://api.yum6.cn/css_format/",{code:txt,method:'ys'},function(result){
|
||||
layer.msg('压缩完成');
|
||||
editor.setValue(result.content);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<?php include '../../footer.php';?>
|
|
@ -1,448 +0,0 @@
|
|||
CodeMirror.defineMode("css", function(config) {
|
||||
var indentUnit = config.indentUnit, type;
|
||||
|
||||
var atMediaTypes = keySet([
|
||||
"all", "aural", "braille", "handheld", "print", "projection", "screen",
|
||||
"tty", "tv", "embossed"
|
||||
]);
|
||||
|
||||
var atMediaFeatures = keySet([
|
||||
"width", "min-width", "max-width", "height", "min-height", "max-height",
|
||||
"device-width", "min-device-width", "max-device-width", "device-height",
|
||||
"min-device-height", "max-device-height", "aspect-ratio",
|
||||
"min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio",
|
||||
"min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color",
|
||||
"max-color", "color-index", "min-color-index", "max-color-index",
|
||||
"monochrome", "min-monochrome", "max-monochrome", "resolution",
|
||||
"min-resolution", "max-resolution", "scan", "grid"
|
||||
]);
|
||||
|
||||
var propertyKeywords = keySet([
|
||||
"align-content", "align-items", "align-self", "alignment-adjust",
|
||||
"alignment-baseline", "anchor-point", "animation", "animation-delay",
|
||||
"animation-direction", "animation-duration", "animation-iteration-count",
|
||||
"animation-name", "animation-play-state", "animation-timing-function",
|
||||
"appearance", "azimuth", "backface-visibility", "background",
|
||||
"background-attachment", "background-clip", "background-color",
|
||||
"background-image", "background-origin", "background-position",
|
||||
"background-repeat", "background-size", "baseline-shift", "binding",
|
||||
"bleed", "bookmark-label", "bookmark-level", "bookmark-state",
|
||||
"bookmark-target", "border", "border-bottom", "border-bottom-color",
|
||||
"border-bottom-left-radius", "border-bottom-right-radius",
|
||||
"border-bottom-style", "border-bottom-width", "border-collapse",
|
||||
"border-color", "border-image", "border-image-outset",
|
||||
"border-image-repeat", "border-image-slice", "border-image-source",
|
||||
"border-image-width", "border-left", "border-left-color",
|
||||
"border-left-style", "border-left-width", "border-radius", "border-right",
|
||||
"border-right-color", "border-right-style", "border-right-width",
|
||||
"border-spacing", "border-style", "border-top", "border-top-color",
|
||||
"border-top-left-radius", "border-top-right-radius", "border-top-style",
|
||||
"border-top-width", "border-width", "bottom", "box-decoration-break",
|
||||
"box-shadow", "box-sizing", "break-after", "break-before", "break-inside",
|
||||
"caption-side", "clear", "clip", "color", "color-profile", "column-count",
|
||||
"column-fill", "column-gap", "column-rule", "column-rule-color",
|
||||
"column-rule-style", "column-rule-width", "column-span", "column-width",
|
||||
"columns", "content", "counter-increment", "counter-reset", "crop", "cue",
|
||||
"cue-after", "cue-before", "cursor", "direction", "display",
|
||||
"dominant-baseline", "drop-initial-after-adjust",
|
||||
"drop-initial-after-align", "drop-initial-before-adjust",
|
||||
"drop-initial-before-align", "drop-initial-size", "drop-initial-value",
|
||||
"elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis",
|
||||
"flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap",
|
||||
"float", "float-offset", "font", "font-feature-settings", "font-family",
|
||||
"font-kerning", "font-language-override", "font-size", "font-size-adjust",
|
||||
"font-stretch", "font-style", "font-synthesis", "font-variant",
|
||||
"font-variant-alternates", "font-variant-caps", "font-variant-east-asian",
|
||||
"font-variant-ligatures", "font-variant-numeric", "font-variant-position",
|
||||
"font-weight", "grid-cell", "grid-column", "grid-column-align",
|
||||
"grid-column-sizing", "grid-column-span", "grid-columns", "grid-flow",
|
||||
"grid-row", "grid-row-align", "grid-row-sizing", "grid-row-span",
|
||||
"grid-rows", "grid-template", "hanging-punctuation", "height", "hyphens",
|
||||
"icon", "image-orientation", "image-rendering", "image-resolution",
|
||||
"inline-box-align", "justify-content", "left", "letter-spacing",
|
||||
"line-break", "line-height", "line-stacking", "line-stacking-ruby",
|
||||
"line-stacking-shift", "line-stacking-strategy", "list-style",
|
||||
"list-style-image", "list-style-position", "list-style-type", "margin",
|
||||
"margin-bottom", "margin-left", "margin-right", "margin-top",
|
||||
"marker-offset", "marks", "marquee-direction", "marquee-loop",
|
||||
"marquee-play-count", "marquee-speed", "marquee-style", "max-height",
|
||||
"max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index",
|
||||
"nav-left", "nav-right", "nav-up", "opacity", "order", "orphans", "outline",
|
||||
"outline-color", "outline-offset", "outline-style", "outline-width",
|
||||
"overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y",
|
||||
"padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
|
||||
"page", "page-break-after", "page-break-before", "page-break-inside",
|
||||
"page-policy", "pause", "pause-after", "pause-before", "perspective",
|
||||
"perspective-origin", "pitch", "pitch-range", "play-during", "position",
|
||||
"presentation-level", "punctuation-trim", "quotes", "rendering-intent",
|
||||
"resize", "rest", "rest-after", "rest-before", "richness", "right",
|
||||
"rotation", "rotation-point", "ruby-align", "ruby-overhang",
|
||||
"ruby-position", "ruby-span", "size", "speak", "speak-as", "speak-header",
|
||||
"speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set",
|
||||
"tab-size", "table-layout", "target", "target-name", "target-new",
|
||||
"target-position", "text-align", "text-align-last", "text-decoration",
|
||||
"text-decoration-color", "text-decoration-line", "text-decoration-skip",
|
||||
"text-decoration-style", "text-emphasis", "text-emphasis-color",
|
||||
"text-emphasis-position", "text-emphasis-style", "text-height",
|
||||
"text-indent", "text-justify", "text-outline", "text-shadow",
|
||||
"text-space-collapse", "text-transform", "text-underline-position",
|
||||
"text-wrap", "top", "transform", "transform-origin", "transform-style",
|
||||
"transition", "transition-delay", "transition-duration",
|
||||
"transition-property", "transition-timing-function", "unicode-bidi",
|
||||
"vertical-align", "visibility", "voice-balance", "voice-duration",
|
||||
"voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress",
|
||||
"voice-volume", "volume", "white-space", "widows", "width", "word-break",
|
||||
"word-spacing", "word-wrap", "z-index"
|
||||
]);
|
||||
|
||||
var colorKeywords = keySet([
|
||||
"black", "silver", "gray", "white", "maroon", "red", "purple", "fuchsia",
|
||||
"green", "lime", "olive", "yellow", "navy", "blue", "teal", "aqua"
|
||||
]);
|
||||
|
||||
var valueKeywords = keySet([
|
||||
"above", "absolute", "activeborder", "activecaption", "afar",
|
||||
"after-white-space", "ahead", "alias", "all", "all-scroll", "alternate",
|
||||
"always", "amharic", "amharic-abegede", "antialiased", "appworkspace",
|
||||
"arabic-indic", "armenian", "asterisks", "auto", "avoid", "background",
|
||||
"backwards", "baseline", "below", "bidi-override", "binary", "bengali",
|
||||
"blink", "block", "block-axis", "bold", "bolder", "border", "border-box",
|
||||
"both", "bottom", "break-all", "break-word", "button", "button-bevel",
|
||||
"buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian",
|
||||
"capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
|
||||
"cell", "center", "checkbox", "circle", "cjk-earthly-branch",
|
||||
"cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
|
||||
"col-resize", "collapse", "compact", "condensed", "contain", "content",
|
||||
"content-box", "context-menu", "continuous", "copy", "cover", "crop",
|
||||
"cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal",
|
||||
"decimal-leading-zero", "default", "default-button", "destination-atop",
|
||||
"destination-in", "destination-out", "destination-over", "devanagari",
|
||||
"disc", "discard", "document", "dot-dash", "dot-dot-dash", "dotted",
|
||||
"double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
|
||||
"element", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",
|
||||
"ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",
|
||||
"ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",
|
||||
"ethiopic-halehame-aa-et", "ethiopic-halehame-am-et",
|
||||
"ethiopic-halehame-gez", "ethiopic-halehame-om-et",
|
||||
"ethiopic-halehame-sid-et", "ethiopic-halehame-so-et",
|
||||
"ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et",
|
||||
"ethiopic-halehame-tig", "ew-resize", "expanded", "extra-condensed",
|
||||
"extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes",
|
||||
"forwards", "from", "geometricPrecision", "georgian", "graytext", "groove",
|
||||
"gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew",
|
||||
"help", "hidden", "hide", "higher", "highlight", "highlighttext",
|
||||
"hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore",
|
||||
"inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
|
||||
"infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
|
||||
"inline-block", "inline-table", "inset", "inside", "intrinsic", "invert",
|
||||
"italic", "justify", "kannada", "katakana", "katakana-iroha", "khmer",
|
||||
"landscape", "lao", "large", "larger", "left", "level", "lighter",
|
||||
"line-through", "linear", "lines", "list-item", "listbox", "listitem",
|
||||
"local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",
|
||||
"lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",
|
||||
"lower-roman", "lowercase", "ltr", "malayalam", "match",
|
||||
"media-controls-background", "media-current-time-display",
|
||||
"media-fullscreen-button", "media-mute-button", "media-play-button",
|
||||
"media-return-to-realtime-button", "media-rewind-button",
|
||||
"media-seek-back-button", "media-seek-forward-button", "media-slider",
|
||||
"media-sliderthumb", "media-time-remaining-display", "media-volume-slider",
|
||||
"media-volume-slider-container", "media-volume-sliderthumb", "medium",
|
||||
"menu", "menulist", "menulist-button", "menulist-text",
|
||||
"menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic",
|
||||
"mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize",
|
||||
"narrower", "navy", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
|
||||
"no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
|
||||
"ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote",
|
||||
"optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",
|
||||
"outside", "overlay", "overline", "padding", "padding-box", "painted",
|
||||
"paused", "persian", "plus-darker", "plus-lighter", "pointer", "portrait",
|
||||
"pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button",
|
||||
"radio", "read-only", "read-write", "read-write-plaintext-only", "relative",
|
||||
"repeat", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba",
|
||||
"ridge", "right", "round", "row-resize", "rtl", "run-in", "running",
|
||||
"s-resize", "sans-serif", "scroll", "scrollbar", "se-resize", "searchfield",
|
||||
"searchfield-cancel-button", "searchfield-decoration",
|
||||
"searchfield-results-button", "searchfield-results-decoration",
|
||||
"semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
|
||||
"single", "skip-white-space", "slide", "slider-horizontal",
|
||||
"slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
|
||||
"small", "small-caps", "small-caption", "smaller", "solid", "somali",
|
||||
"source-atop", "source-in", "source-out", "source-over", "space", "square",
|
||||
"square-button", "start", "static", "status-bar", "stretch", "stroke",
|
||||
"sub", "subpixel-antialiased", "super", "sw-resize", "table",
|
||||
"table-caption", "table-cell", "table-column", "table-column-group",
|
||||
"table-footer-group", "table-header-group", "table-row", "table-row-group",
|
||||
"telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai",
|
||||
"thick", "thin", "threeddarkshadow", "threedface", "threedhighlight",
|
||||
"threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er",
|
||||
"tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top",
|
||||
"transparent", "ultra-condensed", "ultra-expanded", "underline", "up",
|
||||
"upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal",
|
||||
"upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",
|
||||
"vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
|
||||
"visibleStroke", "visual", "w-resize", "wait", "wave", "white", "wider",
|
||||
"window", "windowframe", "windowtext", "x-large", "x-small", "xor",
|
||||
"xx-large", "xx-small", "yellow"
|
||||
]);
|
||||
|
||||
function keySet(array) { var keys = {}; for (var i = 0; i < array.length; ++i) keys[array[i]] = true; return keys; }
|
||||
function ret(style, tp) {type = tp; return style;}
|
||||
|
||||
function tokenBase(stream, state) {
|
||||
var ch = stream.next();
|
||||
if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("def", stream.current());}
|
||||
else if (ch == "/" && stream.eat("*")) {
|
||||
state.tokenize = tokenCComment;
|
||||
return tokenCComment(stream, state);
|
||||
}
|
||||
else if (ch == "<" && stream.eat("!")) {
|
||||
state.tokenize = tokenSGMLComment;
|
||||
return tokenSGMLComment(stream, state);
|
||||
}
|
||||
else if (ch == "=") ret(null, "compare");
|
||||
else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare");
|
||||
else if (ch == "\"" || ch == "'") {
|
||||
state.tokenize = tokenString(ch);
|
||||
return state.tokenize(stream, state);
|
||||
}
|
||||
else if (ch == "#") {
|
||||
stream.eatWhile(/[\w\\\-]/);
|
||||
return ret("atom", "hash");
|
||||
}
|
||||
else if (ch == "!") {
|
||||
stream.match(/^\s*\w*/);
|
||||
return ret("keyword", "important");
|
||||
}
|
||||
else if (/\d/.test(ch)) {
|
||||
stream.eatWhile(/[\w.%]/);
|
||||
return ret("number", "unit");
|
||||
}
|
||||
else if (ch === "-") {
|
||||
if (/\d/.test(stream.peek())) {
|
||||
stream.eatWhile(/[\w.%]/);
|
||||
return ret("number", "unit");
|
||||
} else if (stream.match(/^[^-]+-/)) {
|
||||
return ret("meta", type);
|
||||
}
|
||||
}
|
||||
else if (/[,+>*\/]/.test(ch)) {
|
||||
return ret(null, "select-op");
|
||||
}
|
||||
else if (ch == "." && stream.match(/^\w+/)) {
|
||||
return ret("qualifier", type);
|
||||
}
|
||||
else if (ch == ":") {
|
||||
return ret("operator", ch);
|
||||
}
|
||||
else if (/[;{}\[\]\(\)]/.test(ch)) {
|
||||
return ret(null, ch);
|
||||
}
|
||||
else {
|
||||
stream.eatWhile(/[\w\\\-]/);
|
||||
return ret("property", "variable");
|
||||
}
|
||||
}
|
||||
|
||||
function tokenCComment(stream, state) {
|
||||
var maybeEnd = false, ch;
|
||||
while ((ch = stream.next()) != null) {
|
||||
if (maybeEnd && ch == "/") {
|
||||
state.tokenize = tokenBase;
|
||||
break;
|
||||
}
|
||||
maybeEnd = (ch == "*");
|
||||
}
|
||||
return ret("comment", "comment");
|
||||
}
|
||||
|
||||
function tokenSGMLComment(stream, state) {
|
||||
var dashes = 0, ch;
|
||||
while ((ch = stream.next()) != null) {
|
||||
if (dashes >= 2 && ch == ">") {
|
||||
state.tokenize = tokenBase;
|
||||
break;
|
||||
}
|
||||
dashes = (ch == "-") ? dashes + 1 : 0;
|
||||
}
|
||||
return ret("comment", "comment");
|
||||
}
|
||||
|
||||
function tokenString(quote) {
|
||||
return function(stream, state) {
|
||||
var escaped = false, ch;
|
||||
while ((ch = stream.next()) != null) {
|
||||
if (ch == quote && !escaped)
|
||||
break;
|
||||
escaped = !escaped && ch == "\\";
|
||||
}
|
||||
if (!escaped) state.tokenize = tokenBase;
|
||||
return ret("string", "string");
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
startState: function(base) {
|
||||
return {tokenize: tokenBase,
|
||||
baseIndent: base || 0,
|
||||
stack: []};
|
||||
},
|
||||
|
||||
token: function(stream, state) {
|
||||
|
||||
// Use these terms when applicable (see http://www.xanthir.com/blog/b4E50)
|
||||
//
|
||||
// rule** or **ruleset:
|
||||
// A selector + braces combo, or an at-rule.
|
||||
//
|
||||
// declaration block:
|
||||
// A sequence of declarations.
|
||||
//
|
||||
// declaration:
|
||||
// A property + colon + value combo.
|
||||
//
|
||||
// property value:
|
||||
// The entire value of a property.
|
||||
//
|
||||
// component value:
|
||||
// A single piece of a property value. Like the 5px in
|
||||
// text-shadow: 0 0 5px blue;. Can also refer to things that are
|
||||
// multiple terms, like the 1-4 terms that make up the background-size
|
||||
// portion of the background shorthand.
|
||||
//
|
||||
// term:
|
||||
// The basic unit of author-facing CSS, like a single number (5),
|
||||
// dimension (5px), string ("foo"), or function. Officially defined
|
||||
// by the CSS 2.1 grammar (look for the 'term' production)
|
||||
//
|
||||
//
|
||||
// simple selector:
|
||||
// A single atomic selector, like a type selector, an attr selector, a
|
||||
// class selector, etc.
|
||||
//
|
||||
// compound selector:
|
||||
// One or more simple selectors without a combinator. div.example is
|
||||
// compound, div > .example is not.
|
||||
//
|
||||
// complex selector:
|
||||
// One or more compound selectors chained with combinators.
|
||||
//
|
||||
// combinator:
|
||||
// The parts of selectors that express relationships. There are four
|
||||
// currently - the space (descendant combinator), the greater-than
|
||||
// bracket (child combinator), the plus sign (next sibling combinator),
|
||||
// and the tilda (following sibling combinator).
|
||||
//
|
||||
// sequence of selectors:
|
||||
// One or more of the named type of selector chained with commas.
|
||||
|
||||
if (stream.eatSpace()) return null;
|
||||
var style = state.tokenize(stream, state);
|
||||
|
||||
// Changing style returned based on context
|
||||
var context = state.stack[state.stack.length-1];
|
||||
if (style == "property") {
|
||||
if (context == "propertyValue"){
|
||||
if (valueKeywords[stream.current()]) {
|
||||
style = "string-2";
|
||||
} else if (colorKeywords[stream.current()]) {
|
||||
style = "keyword";
|
||||
} else {
|
||||
style = "variable-2";
|
||||
}
|
||||
} else if (context == "rule") {
|
||||
if (!propertyKeywords[stream.current()]) {
|
||||
style += " error";
|
||||
}
|
||||
} else if (!context || context == "@media{") {
|
||||
style = "tag";
|
||||
} else if (context == "@media") {
|
||||
if (atMediaTypes[stream.current()]) {
|
||||
style = "attribute"; // Known attribute
|
||||
} else if (/^(only|not)$/i.test(stream.current())) {
|
||||
style = "keyword";
|
||||
} else if (stream.current().toLowerCase() == "and") {
|
||||
style = "error"; // "and" is only allowed in @mediaType
|
||||
} else if (atMediaFeatures[stream.current()]) {
|
||||
style = "error"; // Known property, should be in @mediaType(
|
||||
} else {
|
||||
// Unknown, expecting keyword or attribute, assuming attribute
|
||||
style = "attribute error";
|
||||
}
|
||||
} else if (context == "@mediaType") {
|
||||
if (atMediaTypes[stream.current()]) {
|
||||
style = "attribute";
|
||||
} else if (stream.current().toLowerCase() == "and") {
|
||||
style = "operator";
|
||||
} else if (/^(only|not)$/i.test(stream.current())) {
|
||||
style = "error"; // Only allowed in @media
|
||||
} else if (atMediaFeatures[stream.current()]) {
|
||||
style = "error"; // Known property, should be in parentheses
|
||||
} else {
|
||||
// Unknown attribute or property, but expecting property (preceded
|
||||
// by "and"). Should be in parentheses
|
||||
style = "error";
|
||||
}
|
||||
} else if (context == "@mediaType(") {
|
||||
if (propertyKeywords[stream.current()]) {
|
||||
// do nothing, remains "property"
|
||||
} else if (atMediaTypes[stream.current()]) {
|
||||
style = "error"; // Known property, should be in parentheses
|
||||
} else if (stream.current().toLowerCase() == "and") {
|
||||
style = "operator";
|
||||
} else if (/^(only|not)$/i.test(stream.current())) {
|
||||
style = "error"; // Only allowed in @media
|
||||
} else {
|
||||
style += " error";
|
||||
}
|
||||
} else {
|
||||
style = "error";
|
||||
}
|
||||
} else if (style == "atom") {
|
||||
if(!context || context == "@media{") {
|
||||
style = "builtin";
|
||||
} else if (context == "propertyValue") {
|
||||
if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) {
|
||||
style += " error";
|
||||
}
|
||||
} else {
|
||||
style = "error";
|
||||
}
|
||||
} else if (context == "@media" && type == "{") {
|
||||
style = "error";
|
||||
}
|
||||
|
||||
// Push/pop context stack
|
||||
if (type == "{") {
|
||||
if (context == "@media" || context == "@mediaType") {
|
||||
state.stack.pop();
|
||||
state.stack[state.stack.length-1] = "@media{";
|
||||
}
|
||||
else state.stack.push("rule");
|
||||
}
|
||||
else if (type == "}") {
|
||||
state.stack.pop();
|
||||
if (context == "propertyValue") state.stack.pop();
|
||||
}
|
||||
else if (type == "@media") state.stack.push("@media");
|
||||
else if (context == "@media" && /\b(keyword|attribute)\b/.test(style))
|
||||
state.stack.push("@mediaType");
|
||||
else if (context == "@mediaType" && stream.current() == ",") state.stack.pop();
|
||||
else if (context == "@mediaType" && type == "(") state.stack.push("@mediaType(");
|
||||
else if (context == "@mediaType(" && type == ")") state.stack.pop();
|
||||
else if (context == "rule" && type == ":") state.stack.push("propertyValue");
|
||||
else if (context == "propertyValue" && type == ";") state.stack.pop();
|
||||
return style;
|
||||
},
|
||||
|
||||
indent: function(state, textAfter) {
|
||||
var n = state.stack.length;
|
||||
if (/^\}/.test(textAfter))
|
||||
n -= state.stack[state.stack.length-1] == "propertyValue" ? 2 : 1;
|
||||
return state.baseIndent + n * indentUnit;
|
||||
},
|
||||
|
||||
electricChars: "}"
|
||||
};
|
||||
});
|
||||
|
||||
CodeMirror.defineMIME("text/css", "css");
|
|
@ -1,440 +0,0 @@
|
|||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
function cssbeautify(style, opt) {
|
||||
|
||||
var options, index = 0, length = style.length, blocks, formatted = '',
|
||||
ch, ch2, str, state, State, depth, quote, comment,
|
||||
openbracesuffix = true,
|
||||
autosemicolon = false,
|
||||
trimRight;
|
||||
|
||||
options = arguments.length > 1 ? opt : {};
|
||||
if (typeof options.indent === 'undefined') {
|
||||
options.indent = ' ';
|
||||
}
|
||||
if (typeof options.openbrace === 'string') {
|
||||
openbracesuffix = (options.openbrace === 'end-of-line');
|
||||
}
|
||||
if (typeof options.autosemicolon === 'boolean') {
|
||||
autosemicolon = options.autosemicolon;
|
||||
}
|
||||
|
||||
function isWhitespace(c) {
|
||||
return (c === ' ') || (c === '\n') || (c === '\t') || (c === '\r') || (c === '\f');
|
||||
}
|
||||
|
||||
function isQuote(c) {
|
||||
return (c === '\'') || (c === '"');
|
||||
}
|
||||
|
||||
// FIXME: handle Unicode characters
|
||||
function isName(c) {
|
||||
return (ch >= 'a' && ch <= 'z') ||
|
||||
(ch >= 'A' && ch <= 'Z') ||
|
||||
(ch >= '0' && ch <= '9') ||
|
||||
'-_*.:#[]'.indexOf(c) >= 0;
|
||||
}
|
||||
|
||||
function appendIndent() {
|
||||
var i;
|
||||
for (i = depth; i > 0; i -= 1) {
|
||||
formatted += options.indent;
|
||||
}
|
||||
}
|
||||
|
||||
function openBlock() {
|
||||
formatted = trimRight(formatted);
|
||||
if (openbracesuffix) {
|
||||
formatted += ' {';
|
||||
} else {
|
||||
formatted += '\n';
|
||||
appendIndent();
|
||||
formatted += '{';
|
||||
}
|
||||
if (ch2 !== '\n') {
|
||||
formatted += '\n';
|
||||
}
|
||||
depth += 1;
|
||||
}
|
||||
|
||||
function closeBlock() {
|
||||
var last;
|
||||
depth -= 1;
|
||||
formatted = trimRight(formatted);
|
||||
|
||||
if (formatted.length > 0 && autosemicolon) {
|
||||
last = formatted.charAt(formatted.length - 1);
|
||||
if (last !== ';' && last !== '{') {
|
||||
formatted += ';';
|
||||
}
|
||||
}
|
||||
|
||||
formatted += '\n';
|
||||
appendIndent();
|
||||
formatted += '}';
|
||||
blocks.push(formatted);
|
||||
formatted = '';
|
||||
}
|
||||
|
||||
if (String.prototype.trimRight) {
|
||||
trimRight = function (s) {
|
||||
return s.trimRight();
|
||||
};
|
||||
} else {
|
||||
// old Internet Explorer
|
||||
trimRight = function (s) {
|
||||
return s.replace(/\s+$/, '');
|
||||
};
|
||||
}
|
||||
|
||||
State = {
|
||||
Start: 0,
|
||||
AtRule: 1,
|
||||
Block: 2,
|
||||
Selector: 3,
|
||||
Ruleset: 4,
|
||||
Property: 5,
|
||||
Separator: 6,
|
||||
Expression: 7,
|
||||
URL: 8
|
||||
};
|
||||
|
||||
depth = 0;
|
||||
state = State.Start;
|
||||
comment = false;
|
||||
blocks = [];
|
||||
|
||||
// We want to deal with LF (\n) only
|
||||
style = style.replace(/\r\n/g, '\n');
|
||||
|
||||
while (index < length) {
|
||||
ch = style.charAt(index);
|
||||
ch2 = style.charAt(index + 1);
|
||||
index += 1;
|
||||
|
||||
// Inside a string literal?
|
||||
if (isQuote(quote)) {
|
||||
formatted += ch;
|
||||
if (ch === quote) {
|
||||
quote = null;
|
||||
}
|
||||
if (ch === '\\' && ch2 === quote) {
|
||||
// Don't treat escaped character as the closing quote
|
||||
formatted += ch2;
|
||||
index += 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// Starting a string literal?
|
||||
if (isQuote(ch)) {
|
||||
formatted += ch;
|
||||
quote = ch;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Comment
|
||||
if (comment) {
|
||||
formatted += ch;
|
||||
if (ch === '*' && ch2 === '/') {
|
||||
comment = false;
|
||||
formatted += ch2;
|
||||
index += 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (ch === '/' && ch2 === '*') {
|
||||
comment = true;
|
||||
formatted += ch;
|
||||
formatted += ch2;
|
||||
index += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (state === State.Start) {
|
||||
|
||||
if (blocks.length === 0) {
|
||||
if (isWhitespace(ch) && formatted.length === 0) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Copy white spaces and control characters
|
||||
if (ch <= ' ' || ch.charCodeAt(0) >= 128) {
|
||||
state = State.Start;
|
||||
formatted += ch;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Selector or at-rule
|
||||
if (isName(ch) || (ch === '@')) {
|
||||
|
||||
// Clear trailing whitespaces and linefeeds.
|
||||
str = trimRight(formatted);
|
||||
|
||||
if (str.length === 0) {
|
||||
// If we have empty string after removing all the trailing
|
||||
// spaces, that means we are right after a block.
|
||||
// Ensure a blank line as the separator.
|
||||
if (blocks.length > 0) {
|
||||
formatted = '\n\n';
|
||||
}
|
||||
} else {
|
||||
// After finishing a ruleset or directive statement,
|
||||
// there should be one blank line.
|
||||
if (str.charAt(str.length - 1) === '}' ||
|
||||
str.charAt(str.length - 1) === ';') {
|
||||
|
||||
formatted = str + '\n\n';
|
||||
} else {
|
||||
// After block comment, keep all the linefeeds but
|
||||
// start from the first column (remove whitespaces prefix).
|
||||
while (true) {
|
||||
ch2 = formatted.charAt(formatted.length - 1);
|
||||
if (ch2 !== ' ' && ch2.charCodeAt(0) !== 9) {
|
||||
break;
|
||||
}
|
||||
formatted = formatted.substr(0, formatted.length - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
formatted += ch;
|
||||
state = (ch === '@') ? State.AtRule : State.Selector;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (state === State.AtRule) {
|
||||
|
||||
// ';' terminates a statement.
|
||||
if (ch === ';') {
|
||||
formatted += ch;
|
||||
state = State.Start;
|
||||
continue;
|
||||
}
|
||||
|
||||
// '{' starts a block
|
||||
if (ch === '{') {
|
||||
str = trimRight(formatted);
|
||||
openBlock();
|
||||
state = (str === '@font-face') ? State.Ruleset : State.Block;
|
||||
continue;
|
||||
}
|
||||
|
||||
formatted += ch;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (state === State.Block) {
|
||||
|
||||
// Selector
|
||||
if (isName(ch)) {
|
||||
|
||||
// Clear trailing whitespaces and linefeeds.
|
||||
str = trimRight(formatted);
|
||||
|
||||
if (str.length === 0) {
|
||||
// If we have empty string after removing all the trailing
|
||||
// spaces, that means we are right after a block.
|
||||
// Ensure a blank line as the separator.
|
||||
if (blocks.length > 0) {
|
||||
formatted = '\n\n';
|
||||
}
|
||||
} else {
|
||||
// Insert blank line if necessary.
|
||||
if (str.charAt(str.length - 1) === '}') {
|
||||
formatted = str + '\n\n';
|
||||
} else {
|
||||
// After block comment, keep all the linefeeds but
|
||||
// start from the first column (remove whitespaces prefix).
|
||||
while (true) {
|
||||
ch2 = formatted.charAt(formatted.length - 1);
|
||||
if (ch2 !== ' ' && ch2.charCodeAt(0) !== 9) {
|
||||
break;
|
||||
}
|
||||
formatted = formatted.substr(0, formatted.length - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
appendIndent();
|
||||
formatted += ch;
|
||||
state = State.Selector;
|
||||
continue;
|
||||
}
|
||||
|
||||
// '}' resets the state.
|
||||
if (ch === '}') {
|
||||
closeBlock();
|
||||
state = State.Start;
|
||||
continue;
|
||||
}
|
||||
|
||||
formatted += ch;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (state === State.Selector) {
|
||||
|
||||
// '{' starts the ruleset.
|
||||
if (ch === '{') {
|
||||
openBlock();
|
||||
state = State.Ruleset;
|
||||
continue;
|
||||
}
|
||||
|
||||
// '}' resets the state.
|
||||
if (ch === '}') {
|
||||
closeBlock();
|
||||
state = State.Start;
|
||||
continue;
|
||||
}
|
||||
|
||||
formatted += ch;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (state === State.Ruleset) {
|
||||
|
||||
// '}' finishes the ruleset.
|
||||
if (ch === '}') {
|
||||
closeBlock();
|
||||
state = State.Start;
|
||||
if (depth > 0) {
|
||||
state = State.Block;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// Make sure there is no blank line or trailing spaces inbetween
|
||||
if (ch === '\n') {
|
||||
formatted = trimRight(formatted);
|
||||
formatted += '\n';
|
||||
continue;
|
||||
}
|
||||
|
||||
// property name
|
||||
if (!isWhitespace(ch)) {
|
||||
formatted = trimRight(formatted);
|
||||
formatted += '\n';
|
||||
appendIndent();
|
||||
formatted += ch;
|
||||
state = State.Property;
|
||||
continue;
|
||||
}
|
||||
formatted += ch;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (state === State.Property) {
|
||||
|
||||
// ':' concludes the property.
|
||||
if (ch === ':') {
|
||||
formatted = trimRight(formatted);
|
||||
formatted += ': ';
|
||||
state = State.Expression;
|
||||
if (isWhitespace(ch2)) {
|
||||
state = State.Separator;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// '}' finishes the ruleset.
|
||||
if (ch === '}') {
|
||||
closeBlock();
|
||||
state = State.Start;
|
||||
if (depth > 0) {
|
||||
state = State.Block;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
formatted += ch;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (state === State.Separator) {
|
||||
|
||||
// Non-whitespace starts the expression.
|
||||
if (!isWhitespace(ch)) {
|
||||
formatted += ch;
|
||||
state = State.Expression;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Anticipate string literal.
|
||||
if (isQuote(ch2)) {
|
||||
state = State.Expression;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (state === State.Expression) {
|
||||
|
||||
// '}' finishes the ruleset.
|
||||
if (ch === '}') {
|
||||
closeBlock();
|
||||
state = State.Start;
|
||||
if (depth > 0) {
|
||||
state = State.Block;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// ';' completes the declaration.
|
||||
if (ch === ';') {
|
||||
formatted = trimRight(formatted);
|
||||
formatted += ';\n';
|
||||
state = State.Ruleset;
|
||||
continue;
|
||||
}
|
||||
|
||||
formatted += ch;
|
||||
|
||||
if (ch === '(') {
|
||||
if (formatted.charAt(formatted.length - 2) === 'l' &&
|
||||
formatted.charAt(formatted.length - 3) === 'r' &&
|
||||
formatted.charAt(formatted.length - 4) === 'u') {
|
||||
|
||||
// URL starts with '(' and closes with ')'.
|
||||
state = State.URL;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (state === State.URL) {
|
||||
|
||||
|
||||
// ')' finishes the URL (only if it is not escaped).
|
||||
if (ch === ')' && formatted.charAt(formatted.length - 1 !== '\\')) {
|
||||
formatted += ch;
|
||||
state = State.Expression;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// The default action is to copy the character (to prevent
|
||||
// infinite loop).
|
||||
formatted += ch;
|
||||
}
|
||||
|
||||
formatted = blocks.join('') + formatted;
|
||||
|
||||
return formatted;
|
||||
}
|
||||
|
||||
if (typeof exports !== 'undefined') {
|
||||
// Node.js module.
|
||||
module.exports = exports = cssbeautify;
|
||||
} else if (typeof window === 'object') {
|
||||
// Browser loading.
|
||||
window.cssbeautify = cssbeautify;
|
||||
}
|
||||
|
||||
}());
|
|
@ -1,72 +0,0 @@
|
|||
/*global cssbeautify:true, document:true, window:true, CodeMirror: true */
|
||||
|
||||
var editor, viewer, formatId;
|
||||
|
||||
function format() {
|
||||
'use strict';
|
||||
if (formatId) {
|
||||
window.clearTimeout(formatId);
|
||||
}
|
||||
formatId = window.setTimeout(function () {
|
||||
var options, raw, beautified;
|
||||
|
||||
options = {
|
||||
indent: ' '
|
||||
};
|
||||
|
||||
if (document.getElementById('tab').checked) {
|
||||
options.indent = '\t';
|
||||
} else if (document.getElementById('twospaces').checked) {
|
||||
options.indent = ' ';
|
||||
}
|
||||
|
||||
if (document.getElementById('openbrace-separate-line').checked) {
|
||||
options.openbrace = 'separate-line';
|
||||
}
|
||||
|
||||
if (document.getElementById('autosemicolon').checked) {
|
||||
options.autosemicolon = true;
|
||||
}
|
||||
|
||||
if (typeof editor === undefined) {
|
||||
raw = document.getElementById('raw').value;
|
||||
} else {
|
||||
raw = editor.getValue();
|
||||
}
|
||||
|
||||
|
||||
|
||||
beautified = cssbeautify(raw, options);
|
||||
|
||||
if (typeof viewer === undefined) {
|
||||
document.getElementById('beautified').value = beautified;
|
||||
} else {
|
||||
viewer.setValue(beautified);
|
||||
}
|
||||
|
||||
formatId = undefined;
|
||||
}, 42);
|
||||
}
|
||||
|
||||
window.onload = function () {
|
||||
'use strict';
|
||||
|
||||
editor = CodeMirror.fromTextArea(document.getElementById("raw"), {
|
||||
lineNumbers: true,
|
||||
matchBrackets: false,
|
||||
lineWrapping: true,
|
||||
tabSize: 8,
|
||||
onChange: format
|
||||
});
|
||||
|
||||
viewer = CodeMirror.fromTextArea(document.getElementById("beautified"), {
|
||||
lineNumbers: true,
|
||||
matchBrackets: false,
|
||||
lineWrapping: true,
|
||||
readOnly: true,
|
||||
tabSize: 8
|
||||
});
|
||||
|
||||
format();
|
||||
};
|
||||
|
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
|
@ -1,405 +0,0 @@
|
|||
<?php
|
||||
$id = '38';
|
||||
include '../../header.php';
|
||||
ob_start();
|
||||
if(getParam('xiao')||getParam('da')||getParam('dan')||getParam('shuang')||getParam('baozi')){
|
||||
$da = getParam('da') ? getParam('da') : '0';
|
||||
$xiao = getParam('xiao') ? getParam('xiao') : '0';
|
||||
$dan = getParam('dan') ? getParam('dan') : '0';
|
||||
$shuang = getParam('shuang') ? getParam('shuang') : '0';
|
||||
$baozi =getParam('baozi') ? getParam('baozi') : '0';
|
||||
$arra = array('da','xiao','dan','shuang','baozi');
|
||||
$arr_mamey = array($da,$xiao,$dan,$shuang,$baozi);
|
||||
$ya_msg = '';
|
||||
for ($i=0; $i < count($arra); $i++) {
|
||||
$type = $arra[$i];
|
||||
switch ($type) {
|
||||
case 'da':
|
||||
$types = '大';
|
||||
break;
|
||||
case 'xiao':
|
||||
$types = '小';
|
||||
break;
|
||||
case 'dan':
|
||||
$types = '单';
|
||||
break;
|
||||
case 'shuang':
|
||||
$types = '双';
|
||||
break;
|
||||
case 'baozi':
|
||||
$types = '豹子';
|
||||
break;
|
||||
default:
|
||||
$types = '';
|
||||
break;
|
||||
}
|
||||
$mamey = $arr_mamey[$i];
|
||||
if(yazhu($type,$mamey)){
|
||||
if ($arr_mamey[$i]) {
|
||||
$ya_msg.= "押注".$types."成功<br/>";
|
||||
}
|
||||
}else{
|
||||
if ($arr_mamey[$i]) {
|
||||
$ya_msg.= "押注".$types."失败<br/>";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
$ys_msgs = "layer.alert('".$ya_msg."');window.location.href='index.php';";
|
||||
}
|
||||
$cookie = $_COOKIE['username'] ? $_COOKIE['username'] : '';
|
||||
|
||||
$url = curl_request('http://api.yum6.cn/dice_game/index.php/index/yal?type=index&token='.$cookie);
|
||||
|
||||
|
||||
//$url = file_get_contents('https://api.yum6.cn/dice_game/index.php/index/yal?type=index');
|
||||
|
||||
$json = json_decode($url,1);
|
||||
|
||||
if ($json['code']=='210') {
|
||||
$dqqishu = $json['dqqishu'];
|
||||
$outtime = $json['outtime'];
|
||||
$last_qishu = $json['last']['qishu'];
|
||||
$last_jssum = $json['last']['jssum'];
|
||||
$last_dianshu1 = $json['last']['dianshu1'];
|
||||
$last_dianshu2 = $json['last']['dianshu2'];
|
||||
$last_dianshu3 = $json['last']['dianshu3'];
|
||||
$last_dianshustate = $json['last']['dianshustate'];
|
||||
|
||||
$daycount_n = $json['daycount']['countn'];
|
||||
$daycount_m = $json['daycount']['countm'];
|
||||
$yazhu_da = $json['yazhu']['da'];
|
||||
$yazhu_xiao = $json['yazhu']['xiao'];
|
||||
$yazhu_dan = $json['yazhu']['dan'];
|
||||
$yazhu_shuang = $json['yazhu']['shuang'];
|
||||
$yazhu_baozi = $json['yazhu']['baozi'];
|
||||
if($json['userstate']['code']!='206'){
|
||||
$user_state = $json['userstate']['userstate'];
|
||||
$user_id = $json['userstate']['userid'];
|
||||
$user_name = $json['userstate']['username'];
|
||||
$user_jinbi = $json['userstate']['jinbi'];
|
||||
$user_da = $json['userstate']['da'];
|
||||
$user_xiao = $json['userstate']['xiao'];
|
||||
$user_dan = $json['userstate']['dan'];
|
||||
$user_shuang = $json['userstate']['shuang'];
|
||||
$user_baozi = $json['userstate']['baozi'];
|
||||
}
|
||||
}else{
|
||||
eixt('数据接口获取失败');
|
||||
}
|
||||
|
||||
function yazhu($type,$mamey){
|
||||
$cookie = $_COOKIE['username'] ? $_COOKIE['username'] : '';
|
||||
$arr = array('type'=>$type,'mamey'=>$mamey);
|
||||
$ya_url = curl_request('http://api.yum6.cn/dice_game/index.php/index/yal?token='.$cookie,$arr);
|
||||
//$ya_url = request_post('https://api.yum6.cn/dice_game/index.php/index/yal',$arr);
|
||||
//var_dump($ya_url);
|
||||
$ya_json = json_decode($ya_url,1);
|
||||
if($ya_json['msg']=='押注成功'){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<style type="text/css">
|
||||
#dianshuimg img{width:50px;}
|
||||
.shouye-header{padding-top: 10px;}
|
||||
.shouye-b input{width: 100px;}
|
||||
</style>
|
||||
<div class="container">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">骰子游戏</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<ul id="myTab" class="nav nav-tabs">
|
||||
<li class="active"><a href="#shouye" data-toggle="tab">首页</a></li>
|
||||
<li><a href="#user" data-toggle="tab">用户信息</a></li>
|
||||
<li><a href="#touzhu" data-toggle="tab">投注记录</a></li>
|
||||
<li><a href="#lishicx" data-toggle="tab">历史查询</a></li>
|
||||
<li><a href="#gamegz" data-toggle="tab">游戏规则</a></li>
|
||||
<li><a href="#talk" data-toggle="tab" class="talk-list" >交流区</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<div class="tab-pane fade in active" id="shouye">
|
||||
<div class="shouye-header">
|
||||
<h4>数据汇总</h4>
|
||||
<p>今日掷骰总数: <b id="countn"><?php echo $daycount_n;?></b></p>
|
||||
<p>今日掷骰总金币:<b id="countm"><?php echo $daycount_m;?></b></p>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="shouye-b">
|
||||
<h4>第<b id="qishu"><?php echo $dqqishu;?></b>期</h4>
|
||||
<p>剩余<b id="outime"><?php echo $outtime;?></b>秒开蛊,买大买小买定离手</p>
|
||||
<form action="index.php" method="post">
|
||||
<p>小(1赔2)(<b id="xiao_val"><?php echo $yazhu_xiao;?></b>金币) <input type="number" id="xiao" class="yazhu" class="form-control" name="xiao"></p>
|
||||
<p>大(1赔2)(<b id="da_val"><?php echo $yazhu_da;?></b>金币) <input type="number" id="da" class="yazhu" class="form-control" name="da"></p>
|
||||
<p>单(1赔2)(<b id="dan_val"><?php echo $yazhu_dan;?></b>金币) <input type="number" id="dan" class="yazhu" class="form-control" name="dan"></p>
|
||||
<p>双(1赔2)(<b id="shuang_val"><?php echo $yazhu_shuang;?></b>金币) <input type="number" id="shuang" class="yazhu" class="form-control" name="shuang"></p>
|
||||
<p>豹子(1赔10)(<b id="baozi_val"><?php echo $yazhu_baozi;?></b>金币) <input type="number" id="baozi" class="yazhu" class="form-control" name="baozi"></p>
|
||||
<button type="submit" class="btn btn-info">押注提交</button>
|
||||
</form>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="shouye-last">
|
||||
<div class="shouye-header">
|
||||
<h4>上一期开奖结果</h4>
|
||||
<p>上<b id="lastqishu"><?php echo $last_qishu;?></b>期点数<b id="dianshu"><?php echo $last_dianshu1.$last_dianshu2.$last_dianshu3;?></b> <b id="dianshustate"><?php echo $last_dianshustate;?></b>赢家获得<b id="jiesuan"><?php echo $last_jssum;?></b>金币</p>
|
||||
<p id="dianshuimg"><img src="images/<?php echo $last_dianshu1;?>.png"><img src="images/<?php echo $last_dianshu2;?>.png"><img src="images/<?php echo $last_dianshu3;?>.png"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="user">
|
||||
<div class="shouye-header">
|
||||
<h4>用户信息</h4>
|
||||
<?php if($json['userstate']['user_state']=='0'){?>
|
||||
<p>用户未登录</p>
|
||||
|
||||
<p>用户名:<input type="text" name="username" id="username" class="form-control"></p>
|
||||
<p>用户密码:<input type="text" name="password" id="password" class="form-control"></p>
|
||||
<input type="submit" id="login" value="登陆" class="btn btn-primary" onclick="login();">
|
||||
<input type="submit" id="signup" value="注册" class="btn btn-info" onclick="signup();">
|
||||
|
||||
<?php }else{?>
|
||||
<p>用户名:<b id="username"><?php echo $user_name;?></b></p>
|
||||
<p>用户ID:<b id="userid"><?php echo $user_id;?></b></p>
|
||||
<p>携带金币:<b id="usermeny"><?php echo $user_jinbi;?></b></p>
|
||||
<h4>押注情况</h4>
|
||||
<p>大:<b id="user_da"><?php echo $user_da;?></b>金币</p>
|
||||
<p>小:<b id="user_xiao"><?php echo $user_xiao;?></b>金币</p>
|
||||
<p>单:<b id="user_dan"><?php echo $user_dan;?></b>金币</p>
|
||||
<p>双:<b id="user_shuang"><?php echo $user_shuang;?></b>金币</p>
|
||||
<p>豹子:<b id="user_baozi"><?php echo $user_baozi;?></b>金币</p>
|
||||
<a href="javascript:out_user()" id="out_user">退出登录</a>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="touzhu">
|
||||
<div class="shouye-header">
|
||||
<h4>投注记录</h4>
|
||||
<p>会员ID:<input type="number" name="userid" id="userid_q" value="<?php echo $user_id;?>" class="form-control"></p>
|
||||
<p>查询期数:<input type="number" name="qishu" id="qishu_q" value="<?php echo $dqqishu;?>" class="form-control"></p>
|
||||
<input type="submit" id="get_tz" value="查询" class="btn btn-warning" onclick="query();">
|
||||
<p><ol id="que"> </ol></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="lishicx">
|
||||
<div class="shouye-header">
|
||||
<h4>历史记录</h4>
|
||||
<p>显示以往十期的开奖记录</p>
|
||||
<p class="form-inline">期数:<input type="number" id="ls_qishu" class="form-control"><input class="btn btn-link" type="submit" id="qishu_get" value="查找" onclick="qishu_get();"></p>
|
||||
<p><ol class="list" id="list"></ol></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="gamegz">
|
||||
<div class="shouye-header">
|
||||
<h4>游戏规则</h4>
|
||||
<div class="well well-lg">
|
||||
<ol>
|
||||
<li>小:4,5,6,7,8,9,10</li>
|
||||
<li>大:11,12,13,14,15,16,17</li>
|
||||
<li>单:5,7,9,11,13,15,17</li>
|
||||
<li>双:4,6,8,10,12,14,16</li>
|
||||
<li>豹子:三个骰子点数相同</li>
|
||||
<li>每次赢家获得奖金90%</li>
|
||||
<li>每期最多投50000金币</li>
|
||||
<li>五分钟开盘一次</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="talk">
|
||||
<div class="shouye-header">
|
||||
<h4>用户交流区</h4>
|
||||
<p>谨慎发言,否则封IP</p>
|
||||
<p id="talk_content" class="talk_content"></p>
|
||||
<hr/>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">留言内容:</label><span style="color:red;">*</span>
|
||||
<textarea class="form-control" rows="5" id="content" placeholder="文明交流……" name="content" required="required"></textarea>
|
||||
</div>
|
||||
<input type="submit" id="talk_get" value="发布" class="btn btn-info" onclick="talk_get();">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">项目介绍</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<h3>项目简介:</h3>
|
||||
<p>作者:涛 or 杰</p>
|
||||
<p>这是一个纯json实现的一个在线小游戏,具体玩法参考游戏规则</p>
|
||||
<p>项目文档已发布到api文档中</p>
|
||||
<p>地址:<a href="http://doc.yum6.cn/web/#/1?page_id=24" target="_blank">http://doc.yum6.cn/web/#/1?page_id=24</a></p>
|
||||
<p>项目目前可实现多平台对接</p>
|
||||
<p>可参与web,机器人,app等平台移植开发使用</p>
|
||||
<h3>声明:</h3>
|
||||
<p>《刑法》第三百零三条规定:“以营利为目的,聚众赌博、开设赌场或者以赌博为业的,处三年以下有期徒刑、拘役或者管制,并处罚金。</p>
|
||||
<p>本项目只是概率小游戏并不涉及盈利,请无脑用户带上脑子</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
<?php if($ys_msgs){echo $ys_msgs;}?>
|
||||
// function login(){
|
||||
// var username = $('#username').val();
|
||||
// var password = $('#password').val();
|
||||
// $.post('login.php',{username:username,password:password},function(data){
|
||||
// if (data.code == '200') {
|
||||
// layer.alert(data.msg);
|
||||
// window.location.href="index.php";
|
||||
// }else{
|
||||
// layer.alert(data.msg);
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
function settime(outtime) {
|
||||
if (outtime == 0) {
|
||||
window.location.reload();
|
||||
} else {
|
||||
$('#outime').html(outtime);
|
||||
outtime--;
|
||||
}
|
||||
setTimeout(function() {
|
||||
settime(outtime)
|
||||
},950)
|
||||
}
|
||||
$(function(){
|
||||
settime('<?php if($outtime){echo $outtime;}else{echo '999';};?>');
|
||||
});
|
||||
|
||||
function query(){
|
||||
var type= "ya";
|
||||
var userid = $('#userid_q').val();
|
||||
var qishu = $('#qishu_q').val();
|
||||
if(userid==''||qishu==''){
|
||||
layer.msg('所有项都不能为空');
|
||||
return false;
|
||||
}
|
||||
$.post('https://api.yum6.cn/dice_game/index.php/query/query/query',{type:type,userid:userid,qishu:qishu},function(data){
|
||||
if(data.code=='200'){
|
||||
layer.msg('查询完毕');
|
||||
if(data.state['msg'] == '输'){state = '损失'}else{state = '盈利'}
|
||||
$('#que').append('<li>期数:'+data.qishu+'开'+data.dianshustate+'('+'押注:大'+data.da+'小'+data.xiao+'单'+data.dan+'双'+data.shuang+'豹子'+data.baozi+')'+' 共计'+state+data.state['num']+'金币</li>');
|
||||
}else if(data.code=='201'){
|
||||
$('#que').append('<li>期数:'+data.qishu+'未开</li>');
|
||||
}else{
|
||||
layer.msg(data.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
$.getJSON("https://api.yum6.cn/dice_game/index.php/query/query/query?type=lishi",function(data){
|
||||
if (data[0]) {
|
||||
for(var a=0;a<data.length;a++){
|
||||
var qishu = data[a]['qishu'];
|
||||
var dianshu1 = data[a]['dianshu1'];
|
||||
var dianshu2 = data[a]['dianshu2'];
|
||||
var dianshu3 = data[a]['dianshu3'];
|
||||
var dianshustate = data[a]['dianshustate'];
|
||||
$('#list').append('<li>第'+qishu+'期开'+dianshu1+dianshu2+dianshu3+' '+dianshustate+'</li>');
|
||||
}
|
||||
}else{
|
||||
layer.msg('历史列表通信错误');
|
||||
}
|
||||
});
|
||||
function qishu_get()
|
||||
{
|
||||
var qishu = $('#ls_qishu').val();
|
||||
var type = 'lishi';
|
||||
$.post("https://api.yum6.cn/dice_game/index.php/query/query/query",{type:type,qishu:qishu},function(data){
|
||||
if (data['code']=="201"){
|
||||
layer.msg('查询完毕');
|
||||
var qishu = data['qishu'];
|
||||
$('#list').append('<li>第'+qishu+'期开未开</li>');
|
||||
}else if(data['code']=="200"){
|
||||
layer.msg('查询完毕');
|
||||
var qishu = data['qishu'];
|
||||
var dianshu1 = data['dianshu1'];
|
||||
var dianshu2 = data['dianshu2'];
|
||||
var dianshu3 = data['dianshu3'];
|
||||
var dianshustate = data['dianshustate'];
|
||||
$('#list').append('<li>第'+qishu+'期开'+dianshu1+dianshu2+dianshu3+' '+dianshustate+'</li>');
|
||||
}else{
|
||||
layer.msg(data.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
$(function(){
|
||||
$.getJSON("https://api.yum6.cn/dice_game/index.php/index/talk/talk_list",function(data){
|
||||
if(data){
|
||||
for(var c =0;c< data.length;c++){
|
||||
$('#talk_content').append('<div class="talk_list"><blockquote><p><b>'+data[c]['username']+'</b>:'+data[c]['content']+'</p><footer>'+data[c]['time']+'</footer></blockquote></div>');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function login(){
|
||||
var username = $('#username').val();
|
||||
var password = $('#password').val();
|
||||
$.post('login.php',{username:username,password:password},function(data){
|
||||
if (data.code == '200') {
|
||||
layer.alert(data.msg);
|
||||
window.location.href="index.php";
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
function signup(){
|
||||
var username = $('#username').val();
|
||||
var password = $('#password').val();
|
||||
$.post('https://api.yum6.cn/dice_game/index.php/user/user/zc',{username:username,password:password},function(data){
|
||||
if (data.code == '200') {
|
||||
layer.alert('注册成功<br/>ID:'+data['user']['userid']+'<br/>账号:'+data['user']['username']+'<br/>密码:'+data['user']['password']+'<br/>初始金币:'+data['user']['csjb']);
|
||||
}else{
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
function out_user(){
|
||||
setCookie('username');
|
||||
layer.msg('已退出');
|
||||
window.location.href="index.php";
|
||||
}
|
||||
function talk_get(){
|
||||
var content = $('#content').val();
|
||||
var cache=getCookie('username');
|
||||
if(content==''){
|
||||
layer.alert('内容为空');
|
||||
return false;
|
||||
}
|
||||
|
||||
$.post('https://api.yum6.cn/dice_game/index.php/index/talk/index',{content:content,token:cache},function(data){
|
||||
console.log(data.code);
|
||||
if(data.code=='200'){
|
||||
layer.alert('已发布');
|
||||
window.location.href="index.php";
|
||||
}else if(data.code=="201"){
|
||||
layer.alert(data.msg);
|
||||
}else if(data.code=='202'){
|
||||
layer.alert(data.msg);
|
||||
}else if(data.code=='203'){
|
||||
layer.alert(data.msg);
|
||||
}else{
|
||||
layer.alert('发布失败');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
<?php include '../../footer.php';?>
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
<?php
|
||||
header('Content-type: application/json');
|
||||
|
||||
$username = strFilter($_POST['username']) ? strFilter($_POST['username']) : '';
|
||||
$password = strFilter($_POST['password']) ? strFilter($_POST['password']) : '';
|
||||
if($username&&$password){
|
||||
$param=array('username'=>$username,'password'=>$password);
|
||||
$url = request_post('http://api.yum6.cn/dice_game/index.php/user/user/login',$param);
|
||||
$json = json_decode($url,1);
|
||||
if($json['code']=="200"){
|
||||
ob_start();
|
||||
setcookie("username",$json['user_token'], time()+3600*24,'/');
|
||||
//$_COOKIE['username'] = $json['user_token'];
|
||||
echo $url;
|
||||
}else{
|
||||
echo $url;
|
||||
}
|
||||
}
|
||||
|
||||
function strFilter($str){
|
||||
//特殊字符替换
|
||||
$str = str_replace('`', '', $str);
|
||||
$str = str_replace('·', '', $str);
|
||||
$str = str_replace('~', '', $str);
|
||||
$str = str_replace('!', '', $str);
|
||||
$str = str_replace('!', '', $str);
|
||||
$str = str_replace('@', '', $str);
|
||||
$str = str_replace('#', '', $str);
|
||||
$str = str_replace('$', '', $str);
|
||||
$str = str_replace('¥', '', $str);
|
||||
$str = str_replace('%', '', $str);
|
||||
$str = str_replace('^', '', $str);
|
||||
$str = str_replace('……', '', $str);
|
||||
$str = str_replace('&', '', $str);
|
||||
$str = str_replace('*', '', $str);
|
||||
$str = str_replace('(', '', $str);
|
||||
$str = str_replace(')', '', $str);
|
||||
$str = str_replace('(', '', $str);
|
||||
$str = str_replace(')', '', $str);
|
||||
$str = str_replace('-', '', $str);
|
||||
$str = str_replace('_', '', $str);
|
||||
$str = str_replace('——', '', $str);
|
||||
$str = str_replace('+', '', $str);
|
||||
$str = str_replace('=', '', $str);
|
||||
$str = str_replace('|', '', $str);
|
||||
$str = str_replace('\\', '', $str);
|
||||
$str = str_replace('[', '', $str);
|
||||
$str = str_replace(']', '', $str);
|
||||
$str = str_replace('【', '', $str);
|
||||
$str = str_replace('】', '', $str);
|
||||
$str = str_replace('{', '', $str);
|
||||
$str = str_replace('}', '', $str);
|
||||
$str = str_replace(';', '', $str);
|
||||
$str = str_replace(';', '', $str);
|
||||
$str = str_replace(':', '', $str);
|
||||
$str = str_replace(':', '', $str);
|
||||
$str = str_replace('\'', '', $str);
|
||||
$str = str_replace('"', '', $str);
|
||||
$str = str_replace('“', '', $str);
|
||||
$str = str_replace('”', '', $str);
|
||||
$str = str_replace(',', '', $str);
|
||||
$str = str_replace(',', '', $str);
|
||||
$str = str_replace('<', '', $str);
|
||||
$str = str_replace('>', '', $str);
|
||||
$str = str_replace('《', '', $str);
|
||||
$str = str_replace('》', '', $str);
|
||||
$str = str_replace('.', '', $str);
|
||||
$str = str_replace('。', '', $str);
|
||||
$str = str_replace('/', '', $str);
|
||||
$str = str_replace('、', '', $str);
|
||||
$str = str_replace('?', '', $str);
|
||||
$str = str_replace('?', '', $str);
|
||||
return trim($str);
|
||||
}
|
||||
|
||||
|
||||
function request_post($url = '', $param = '') {
|
||||
if (empty($url) || empty($param)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$postUrl = $url;
|
||||
$curlPost = $param;
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL,$postUrl);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
|
||||
$data = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
return $data;
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
/**
|
||||
* @act dns
|
||||
* @version 1.0
|
||||
* @author youngxj
|
||||
* @date 2018-03-24
|
||||
* @url http://www.youngxj.cn
|
||||
*/
|
||||
|
||||
var cache=getCookie('cache_url');
|
||||
$('#form-control').val(cache);
|
||||
control('单IP 3s/次');
|
||||
function dns(type){
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.getJSON("https://api.yya.gs/ns_query?q="+$('.form-control').val()+"&t="+type,function(result){
|
||||
if (result.status=='1') {
|
||||
setCookie('cache_url',$('.form-control').val(),365);
|
||||
layer.msg("完成……");
|
||||
$('.form-controls').show();
|
||||
$('#content').append('<h3 style="color: red;">'+result.data[0]['host']+"<small class='text-capitalize'>-"+result.data[0]['type']+"</small></h3><br/>");
|
||||
var x;
|
||||
for (x in result.data){
|
||||
$('#content').append('Class:'+result.data[x]['class']+"<br/>");
|
||||
$('#content').append('TTL(存活时间):'+result.data[x]['ttl']+"<br/>");
|
||||
if (type == 'a') {
|
||||
$('#content').append('IP地址:'+result.data[x]['ip']);
|
||||
}else if (type == 'txt') {
|
||||
$('#content').append('TXT:'+result.data[x]['txt']);
|
||||
}else if (type == 'soa') {
|
||||
$('#content').append('mname:'+result.data[x]['mname']+"<br/>");
|
||||
$('#content').append('rname:'+result.data[x]['rname']+"<br/>");
|
||||
$('#content').append('serial:'+result.data[x]['serial']+"<br/>");
|
||||
$('#content').append('refresh:'+result.data[x]['refresh']+"<br/>");
|
||||
$('#content').append('retry:'+result.data[x]['retry']+"<br/>");
|
||||
$('#content').append('expire:'+result.data[x]['expire']+"<br/>");
|
||||
$('#content').append('minimum-ttl:'+result.data[x]['minimum-ttl']);
|
||||
}else if (type == 'txt') {
|
||||
$('#content').append('TXT:'+result.data[x]['txt']);
|
||||
}else if (type == 'mx') {
|
||||
$('#content').append('Pri:'+result.data[x]['pri']);
|
||||
}else if (type == 'ns' || type == 'mx' || type == 'cname') {
|
||||
$('#content').append('Target:'+result.data[x]['target']);
|
||||
}
|
||||
$('#content').append("<hr/>");
|
||||
}
|
||||
}else if(result.msg=="失败"){
|
||||
layer.alert('失败');
|
||||
}else if(result.msg){
|
||||
layer.alert('请求过快,三秒超过一次');
|
||||
}else{
|
||||
layer.alert('获取失败,请重试!');
|
||||
}
|
||||
});
|
||||
};
|
||||
$("#clear").click(function(){
|
||||
$('.form-controls').hide();
|
||||
$('#content').html('');
|
||||
});
|
|
@ -1,47 +0,0 @@
|
|||
<?php
|
||||
$id="2";
|
||||
include '../../header.php';?>
|
||||
<div class="container clearfix">
|
||||
<div class="row row-xs">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-10 col-xs-offset-1 col-sm-offset-3 col-md-offset-3 col-lg-offset-3">
|
||||
<div class="page-header">
|
||||
<h3 class="text-center h3-xs"><?php echo $title;?><small class="text-capitalize"><?php echo $subtitle;?></small></h3>
|
||||
</div>
|
||||
<h5 class="text-right"><small><?php echo $explains;?></small></h5>
|
||||
<div class="form-group" id="input-wrap">
|
||||
<style type="text/css">
|
||||
#clear:after{content:'清空';position: absolute;top: 0;right: 0;padding: 5px 10px;background: #EA5A47;color: #fff;cursor: pointer;}
|
||||
</style>
|
||||
<label class="control-label control-msg" for="inputContent" copy="Youngxj|杨小杰,admin@youngxj.com"></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" aria-label="..." name="form-control" id="form-control">
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">启动<span class="caret"></span></button>
|
||||
<ul class="dropdown-menu dropdown-menu-right">
|
||||
<li><a href="javascript:dns('ns');">ns</a></li>
|
||||
<li><a href="javascript:dns('a');">a</a></li>
|
||||
<li><a href="javascript:dns('cname');">cname</a></li>
|
||||
<li><a href="javascript:dns('aaaa');">aaaa</a></li>
|
||||
<li><a href="javascript:dns('mx');">mx</a></li>
|
||||
<li><a href="javascript:dns('txt');">txt</a></li>
|
||||
<li><a href="javascript:dns('srv');">srv</a></li>
|
||||
<li><a href="javascript:dns('ptr');">ptr</a></li>
|
||||
<li><a href="javascript:dns('soa');">soa</a></li>
|
||||
<li><a href="javascript:dns('hinfo');">hinfo</a></li>
|
||||
<li><a href="javascript:dns('naptr');">naptr</a></li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li class="disabled"><a href="http://www.youngxj.cn">©Youngxj</a></li>
|
||||
</ul>
|
||||
</div><!-- /btn-group -->
|
||||
</div><!-- /input-group -->
|
||||
</div><!-- /.col-lg-6 -->
|
||||
<div class="form-controls text-left" style="position: relative;">
|
||||
<pre id="content"></pre>
|
||||
<span id="clear"></span>
|
||||
<div id="msg"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="dns.php"></script>
|
||||
<?php include '../../footer.php';?>
|
|
@ -1,46 +0,0 @@
|
|||
/**
|
||||
* @act 手机号查询
|
||||
* @version 1.0
|
||||
* @author youngxj
|
||||
* @date 2018-03-24
|
||||
* @url http://www.youngxj.cn
|
||||
*/
|
||||
|
||||
var i, a = document.getElementsByTagName("head").item(0);
|
||||
b = document.createElement("script");
|
||||
b.setAttribute("src", "http://only-156053-116-7-220-44.nstool.netease.com/info.js");
|
||||
b.setAttribute("type", "text/javascript");
|
||||
b.setAttribute("charset", "gb2312");
|
||||
a.appendChild(b);
|
||||
$(function() {
|
||||
setTimeout("c()", 500)
|
||||
});
|
||||
function c() {
|
||||
var d;
|
||||
a: {
|
||||
try {
|
||||
d = (ip_province, !0);
|
||||
break a
|
||||
} catch(e) {}
|
||||
d = void 0
|
||||
}
|
||||
if (!d) return i++,
|
||||
5 > i ? ($("#res").html('<span class="text-danger">检测失败,自动重试中...</span>'), setTimeout("c()", 500)) : $("#res").html('<span class="text-danger">检测失败,请刷新网页重试<a href="javascript:void(0)" onclick="location.reload()">刷新</a></span>'),
|
||||
!1;
|
||||
$("#ip").html(ip);
|
||||
$("#dns").html(dns);
|
||||
$("#ip_add").html(ip_province + ip_city);
|
||||
$("#dns_add").html(dns_province + dns_city);
|
||||
$("#ip_isp").html(ip_isp);
|
||||
$("#dns_isp").html(dns_isp);
|
||||
switch (res) {
|
||||
case "correct":
|
||||
$("#res").html('<span class="text-success">DNS设置正确</span>');
|
||||
break;
|
||||
case "error":
|
||||
$("#res").html('<span class="text-danger">DNS设置错误</span>');
|
||||
break;
|
||||
default:
|
||||
$("#res").html('<span class="text-muted">未知情况<a href="javascript:void(0)" onclick="location.reload()">刷新</a></span>')
|
||||
}
|
||||
};
|
|
@ -1,79 +0,0 @@
|
|||
<?php
|
||||
$id="21";
|
||||
include '../../header.php';?>
|
||||
<div class="container clearfix">
|
||||
<div class="row row-xs">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-10 col-xs-offset-1 col-sm-offset-3 col-md-offset-3 col-lg-offset-3">
|
||||
<div class="page-header">
|
||||
<h3 class="text-center h3-xs"><?php echo $title;?><small class="text-capitalize"><?php echo $subtitle;?></small></h3>
|
||||
</div>
|
||||
<h5 class="text-right"><small><?php echo $explains;?></small></h5>
|
||||
<div class="form-group" id="input-wrap">
|
||||
<label class="control-label control-msg" for="inputContent" copy="Youngxj|杨小杰,admin@youngxj.com"></label>
|
||||
</div><!-- /.col-lg-6 -->
|
||||
<div class="table-responsive position text-center">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="80px"></th>
|
||||
<th class="text-center">本机IP</th>
|
||||
<th class="text-center">本机DNS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>IP 信息</th>
|
||||
<td id="ip"></td>
|
||||
<td id="dns"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>地址信息</th>
|
||||
<td id="ip_add"></td>
|
||||
<td id="dns_add"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>网络信息</th>
|
||||
<td id="ip_isp"></td>
|
||||
<td id="dns_isp"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>检查结果</th>
|
||||
<td colspan="2" id="res"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">工具简介</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p>利用本工具能检测您本地的上网IP以及DNS相关信息,可用于判断DNS设置是否正确及是否遭到DNS劫持。</p>
|
||||
<p class="text-info">附常用DNS:</p>
|
||||
<p>114DNS
|
||||
<br>114.114.114.114 或 114.114.115.115</p>
|
||||
<p>阿里 DNS (
|
||||
<a href="http://www.alidns.com/" target="_blank">http://www.alidns.com/</a>)
|
||||
<br>223.5.5.5 或 223.6.6.6</p>
|
||||
<p>百度 DNS (
|
||||
<a href="http://dudns.baidu.com/intro/publicdns/" target="_blank">http://dudns.baidu.com/intro/publicdns/</a>)
|
||||
<br>180.76.76.76</p>
|
||||
<p>DNS 派 (
|
||||
<a href="http://www.dnspai.com/public.html" target="_blank">http://www.dnspai.com/public.html</a>)
|
||||
<br>电信:首选:101.226.4.6 联通:首选:123.125.81.6 移动:首选:101.226.4.6 铁通:首选:101.226.4.6</p>
|
||||
<p>OneDNS (
|
||||
<a href="http://www.onedns.net/" target="_blank">http://www.onedns.net/</a>)
|
||||
<br>南方:112.124.47.27 北方:114.215.126.16 共用:42.236.82.22</p>
|
||||
<p>Google DNS
|
||||
<br>8.8.8.8 或 8.8.4.4</p>
|
||||
<p>OpenDNS (
|
||||
<a href="https://www.opendns.com/" target="_blank">https://www.opendns.com/</a>)
|
||||
<br>208.67.222.222 或 208.67.220.220</p>
|
||||
<p>360 DNS
|
||||
<br>101.226.4.6 或 123.125.81.6</p></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="dnstest.php"></script>
|
||||
<?php include '../../footer.php';?>
|
|
@ -1,108 +0,0 @@
|
|||
/**
|
||||
* @act dwzurl
|
||||
* @version 1.0
|
||||
* @author youngxj
|
||||
* @date 2018-03-24
|
||||
* @url http://www.youngxj.cn
|
||||
*/
|
||||
|
||||
var cache=getCookie('cache_url');
|
||||
$('#form-control').val(cache);
|
||||
control('请输入网址:');
|
||||
function dwzurl(){
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.getJSON("https://api.yum6.cn/url.php?url="+$('.form-control').val(),function(data){
|
||||
if (data.code=="1") {
|
||||
setCookie('cache_url',$('.form-control').val(),365);
|
||||
$(".form-controls").html('<textarea class="form-control" rows="3" onclick="oCopy(this)" id="form-control_dwz">'+data.ae_url+'</textarea>');
|
||||
$(".form-controls").show();
|
||||
}else{
|
||||
layer.msg('失败,请重试!');
|
||||
}
|
||||
});
|
||||
}
|
||||
function dwzqrcode(){
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.getJSON("https://api.yum6.cn/url.php?url="+$('.form-control').val(),function(data){
|
||||
if (data.code=="1") {
|
||||
setCookie('cache_url',$('.form-control').val(),365);
|
||||
$(".form-controls").html('<img src="https://api.yum6.cn/url.php?url='+data.ae_url+'&type=qrcode">');
|
||||
$(".form-controls").show();
|
||||
}else{
|
||||
layer.msg('失败,请重试!');
|
||||
}
|
||||
});
|
||||
}
|
||||
function sinadwz(){
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.getJSON("https://api.yum6.cn/sinadwz/?longUrl="+$('.form-control').val(),function(data){
|
||||
if (data.urls[0].url_short) {
|
||||
setCookie('cache_url',$('.form-control').val(),365);
|
||||
$(".form-controls").html('<textarea class="form-control" rows="3" onclick="oCopy(this)" id="form-control_dwz">'+data.urls[0].url_short+'</textarea>');
|
||||
$(".form-controls").show();
|
||||
}else{
|
||||
layer.msg('失败,请重试!');
|
||||
}
|
||||
});
|
||||
}
|
||||
function sinalong(){
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.getJSON("https://api.yum6.cn/sinadwz/?shortUrl="+$('.form-control').val(),function(data){
|
||||
if (data[0].url_long) {
|
||||
setCookie('cache_url',$('.form-control').val(),365);
|
||||
layer.msg('ok');
|
||||
$(".form-controls").html('<textarea class="form-control" rows="3" onclick="oCopy(this)" id="form-control_dwz">'+data[0].url_long+'</textarea>');
|
||||
$(".form-controls").show();
|
||||
}else{
|
||||
layer.msg('失败,请重试!');
|
||||
}
|
||||
});
|
||||
}
|
||||
function sinaqrcode(){
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.getJSON("https://api.yum6.cn/sinadwz/?longUrl="+$('.form-control').val(),function(data){
|
||||
if (data.urls[0].url_short) {
|
||||
setCookie('cache_url',$('.form-control').val(),365);
|
||||
var v = data.urls[0].url_short;
|
||||
$(".form-controls").html('<img src="https://api.yum6.cn/url.php?url='+v+'&type=qrcode">');
|
||||
$(".form-controls").show();
|
||||
}else{
|
||||
layer.msg('失败,请重试!');
|
||||
}
|
||||
});
|
||||
}
|
||||
function eps_gs(){
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.ajax({
|
||||
url: 'https://eps.gs/api/make.php?url='+$('.form-control').val(),
|
||||
type: "GET",
|
||||
dataType: "json", //使用JSON方法进行AJAX
|
||||
success: function (data) {
|
||||
setCookie('cache_url',$('.form-control').val(),365);
|
||||
console.log(data);
|
||||
$(".form-controls").html('<textarea class="form-control" rows="3" onclick="oCopy(this)" id="form-control_dwz">'+data.url_short+'</textarea>');
|
||||
$(".form-controls").show();
|
||||
},
|
||||
error: function (data) {
|
||||
layer.msg('失败,请重试!');
|
||||
}
|
||||
})
|
||||
}
|
||||
function eps_gs_un(){
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.ajax({
|
||||
url: 'https://eps.gs/api/un.php?url='+$('.form-control').val(),
|
||||
type: "GET",
|
||||
dataType: "json", //使用JSON方法进行AJAX
|
||||
success: function (data) {
|
||||
setCookie('cache_url',$('.form-control').val(),365);
|
||||
console.log(data);
|
||||
$(".form-controls").html('<textarea class="form-control" rows="3" onclick="oCopy(this)" id="form-control_dwz">'+data.url_long+'</textarea>');
|
||||
$(".form-controls").show();
|
||||
},
|
||||
error: function (data) {
|
||||
layer.msg('失败,请重试!');
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
<?php
|
||||
$id="3";
|
||||
include '../../header.php';?>
|
||||
<div class="container clearfix">
|
||||
<div class="row row-xs">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-10 col-xs-offset-1 col-sm-offset-3 col-md-offset-3 col-lg-offset-3">
|
||||
<div class="page-header">
|
||||
<h3 class="text-center h3-xs"><?php echo $title;?><small class="text-capitalize"><?php echo $subtitle;?></small></h3>
|
||||
</div>
|
||||
<h5 class="text-right"><small><?php echo $explains;?></small></h5>
|
||||
<div class="form-group" id="input-wrap">
|
||||
<label class="control-label control-msg" for="inputContent" copy="Youngxj|杨小杰,admin@youngxj.com"></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" aria-label="..." id="form-control">
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">启动<span class="caret"></span></button>
|
||||
<ul class="dropdown-menu dropdown-menu-right">
|
||||
<li><a href="javascript:dwzurl()">dwzurl(跳转)</a></li>
|
||||
<li><a href="javascript:dwzqrcode()">dwzqrcode(跳转)</a></li>
|
||||
<li><a href="javascript:sinadwz()">新浪短网址</a></li>
|
||||
<li><a href="javascript:sinalong()">新浪短网址还原</a></li>
|
||||
<li><a href="javascript:eps_gs()">eps.gs短网址</a></li>
|
||||
<li><a href="javascript:eps_gs_un()">eps.gs短网址还原</a></li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li class="disabled"><a href="http://www.youngxj.cn">©Youngxj</a></li>
|
||||
</ul>
|
||||
</div><!-- /btn-group -->
|
||||
</div><!-- /input-group -->
|
||||
</div><!-- /.col-lg-6 -->
|
||||
<div class="form-controls text-center">
|
||||
<label class="control-label" for="inputContent">返回的内容:</label><br/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="dwzurl.php"></script>
|
||||
<?php include '../../footer.php';?>
|
157
Tools/hex/hex.js
|
@ -1,157 +0,0 @@
|
|||
$(document).ready(function() {
|
||||
$('[name="input_"]').click(function() {
|
||||
$('#input_num').val($(this).val());
|
||||
$('#input_value').val("");
|
||||
$('#output_value').val("");
|
||||
});
|
||||
$('[name="output_"]').click(function() {
|
||||
$('#output_num').val($(this).val());
|
||||
px(1);
|
||||
});
|
||||
$("#input_num").change(function() {
|
||||
$("#input_area input").removeAttr("checked");
|
||||
var val = $(this).val();
|
||||
$("#input_area input[value=" + val + "]").attr("checked", "checked");
|
||||
$('#input_value').val("");
|
||||
$('#output_value').val("");
|
||||
});
|
||||
$("#output_num").change(function() {
|
||||
$("#output_area input").removeAttr("checked");
|
||||
var val = $(this).val();
|
||||
$("#output_area input[value=" + val + "]").attr("checked", "checked");
|
||||
px(1);
|
||||
});
|
||||
});
|
||||
function pxparseFloat(x, y) {
|
||||
x = x.toString();
|
||||
var num = x;
|
||||
var data = num.split(".");
|
||||
var you = data[1].split(""); //将右边转换为数组 得到类似 [1,0,1]
|
||||
var sum = 0; //小数部分的和
|
||||
for (var i = 0; i < data[1].length; i++) {
|
||||
sum += you[i] * Math.pow(y, -1 * (i + 1))
|
||||
}
|
||||
return parseInt(data[0], y) + sum;
|
||||
}
|
||||
function zhengze(x) {
|
||||
var str;
|
||||
x = parseInt(x);
|
||||
if (x <= 10) {
|
||||
str = new RegExp("^[+\\-]?[0-" + (x - 1) + "]*[.]?[0-" + (x - 1) + "]*$", "gi");
|
||||
} else {
|
||||
var letter = "";
|
||||
switch (x) {
|
||||
case 11:
|
||||
letter = "a";
|
||||
break;
|
||||
case 12:
|
||||
letter = "b";
|
||||
break;
|
||||
case 13:
|
||||
letter = "c";
|
||||
break;
|
||||
case 14:
|
||||
letter = "d";
|
||||
break;
|
||||
case 15:
|
||||
letter = "e";
|
||||
break;
|
||||
case 16:
|
||||
letter = "f";
|
||||
break;
|
||||
case 17:
|
||||
letter = "g";
|
||||
break;
|
||||
case 18:
|
||||
letter = "h";
|
||||
break;
|
||||
case 19:
|
||||
letter = "i";
|
||||
break;
|
||||
case 20:
|
||||
letter = "j";
|
||||
break;
|
||||
case 21:
|
||||
letter = "k";
|
||||
break;
|
||||
case 22:
|
||||
letter = "l";
|
||||
break;
|
||||
case 23:
|
||||
letter = "m";
|
||||
break;
|
||||
case 24:
|
||||
letter = "n";
|
||||
break;
|
||||
case 25:
|
||||
letter = "o";
|
||||
break;
|
||||
case 26:
|
||||
letter = "p";
|
||||
break;
|
||||
case 27:
|
||||
letter = "q";
|
||||
break;
|
||||
case 28:
|
||||
letter = "r";
|
||||
break;
|
||||
case 29:
|
||||
letter = "s";
|
||||
break;
|
||||
case 30:
|
||||
letter = "t";
|
||||
break;
|
||||
case 31:
|
||||
letter = "u";
|
||||
break;
|
||||
case 32:
|
||||
letter = "v";
|
||||
break;
|
||||
case 33:
|
||||
letter = "w";
|
||||
break;
|
||||
case 34:
|
||||
letter = "x";
|
||||
break;
|
||||
case 35:
|
||||
letter = "y";
|
||||
break;
|
||||
case 36:
|
||||
letter = "z";
|
||||
break;
|
||||
}
|
||||
str = new RegExp("^[+\\-]?[0-9a-" + letter + "]*[.]?[0-9a-" + letter + "]*$", "gi");
|
||||
}
|
||||
return str;
|
||||
}
|
||||
var n = 50;
|
||||
var shurukuang = "";
|
||||
var flag = "";
|
||||
function px(y) {
|
||||
if ($("#input_value").val() != flag || y) {
|
||||
flag = $("#input_value").val();
|
||||
if ($("#input_num").selectedIndex < n) {
|
||||
$("#input_value").val("");
|
||||
$("#output_value").val("");
|
||||
} else {
|
||||
var px00 = $("#input_value").val();
|
||||
var px0 = px00.match(zhengze($("#input_num").val()));
|
||||
if (px0) {
|
||||
if (px0[0].indexOf(".") == -1) {
|
||||
var px1 = parseInt(px0, $('#input_num').val());
|
||||
} else {
|
||||
var px1 = pxparseFloat(px0, $('#input_num').val());
|
||||
}
|
||||
px1 = px1.toString($('#output_num').val());
|
||||
$("#output_value").val(px1);
|
||||
shurukuang = px00;
|
||||
} else {
|
||||
$("#input_value").val(shurukuang);
|
||||
}
|
||||
}
|
||||
n = $("#input_num").selectedIndex;
|
||||
}
|
||||
if ($("#input_value").val() == "") {
|
||||
$("#output_value").val("");
|
||||
}
|
||||
}
|
|
@ -1,137 +0,0 @@
|
|||
<?php
|
||||
$id = '49';
|
||||
include '../../header.php';
|
||||
?>
|
||||
<div class="container">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">在线进制转换</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label for="input_num" class="col-sm-2 control-label">原始进制</label>
|
||||
<div class="col-sm-10">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="input_" value="2">2进制</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="input_" value="4">4进制</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="input_" value="8">8进制</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="input_" value="10" checked="checked">10进制</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="input_" value="16">16进制</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="input_" value="32">32进制</label>
|
||||
<select id="input_num" class="input-small form-control" style="width: 100px; float:right;">
|
||||
<option value="2">2进制</option>
|
||||
<option value="3">3进制</option>
|
||||
<option value="4">4进制</option>
|
||||
<option value="5">5进制</option>
|
||||
<option value="6">6进制</option>
|
||||
<option value="7">7进制</option>
|
||||
<option value="8">8进制</option>
|
||||
<option value="9">9进制</option>
|
||||
<option value="10" selected="">10进制</option>
|
||||
<option value="11">11进制</option>
|
||||
<option value="12">12进制</option>
|
||||
<option value="13">13进制</option>
|
||||
<option value="14">14进制</option>
|
||||
<option value="15">15进制</option>
|
||||
<option value="16">16进制</option>
|
||||
<option value="17">17进制</option>
|
||||
<option value="18">18进制</option>
|
||||
<option value="19">19进制</option>
|
||||
<option value="20">20进制</option>
|
||||
<option value="21">21进制</option>
|
||||
<option value="22">22进制</option>
|
||||
<option value="23">23进制</option>
|
||||
<option value="24">24进制</option>
|
||||
<option value="25">25进制</option>
|
||||
<option value="26">26进制</option>
|
||||
<option value="27">27进制</option>
|
||||
<option value="28">28进制</option>
|
||||
<option value="29">29进制</option>
|
||||
<option value="30">30进制</option>
|
||||
<option value="31">31进制</option>
|
||||
<option value="32">32进制</option>
|
||||
<option value="33">33进制</option>
|
||||
<option value="34">34进制</option>
|
||||
<option value="35">35进制</option>
|
||||
<option value="36">36进制</option></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="input_value" class="col-sm-2 control-label">转换数字</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="input_value" type="text" value="" onpropertychange="px()" onchange="px()" oninput="px()" class="toolInput num_value form-control" placeholder="在此输入待转换数字"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="output_num" class="col-sm-2 control-label">目标进制</label>
|
||||
<div class="col-sm-10">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="output_" value="2">2进制</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="output_" value="4">4进制</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="output_" value="8">8进制</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="output_" value="10">10进制</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="output_" value="16" checked="checked">16进制</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="output_" value="32">32进制</label>
|
||||
<select id="output_num" onchange="px(1);" class="input-small form-control" style="width: 100px; float:right;">
|
||||
<option value="2">2进制</option>
|
||||
<option value="3">3进制</option>
|
||||
<option value="4">4进制</option>
|
||||
<option value="5">5进制</option>
|
||||
<option value="6">6进制</option>
|
||||
<option value="7">7进制</option>
|
||||
<option value="8">8进制</option>
|
||||
<option value="9">9进制</option>
|
||||
<option value="10">10进制</option>
|
||||
<option value="11">11进制</option>
|
||||
<option value="12">12进制</option>
|
||||
<option value="13">13进制</option>
|
||||
<option value="14">14进制</option>
|
||||
<option value="15">15进制</option>
|
||||
<option value="16" selected="">16进制</option>
|
||||
<option value="17">17进制</option>
|
||||
<option value="18">18进制</option>
|
||||
<option value="19">19进制</option>
|
||||
<option value="20">20进制</option>
|
||||
<option value="21">21进制</option>
|
||||
<option value="22">22进制</option>
|
||||
<option value="23">23进制</option>
|
||||
<option value="24">24进制</option>
|
||||
<option value="25">25进制</option>
|
||||
<option value="26">26进制</option>
|
||||
<option value="27">27进制</option>
|
||||
<option value="28">28进制</option>
|
||||
<option value="29">29进制</option>
|
||||
<option value="30">30进制</option>
|
||||
<option value="31">31进制</option>
|
||||
<option value="32">32进制</option>
|
||||
<option value="33">33进制</option>
|
||||
<option value="34">34进制</option>
|
||||
<option value="35">35进制</option>
|
||||
<option value="36">36进制</option></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="output_value" class="col-sm-2 control-label">转换结果</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" id="output_value" class="toolInput num_value form-control" placeholder="转换结果"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">工具简介</div>
|
||||
<div class="panel-body">
|
||||
<p>支持在2~36进制之间进行任意转换,支持浮点型。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="hex.js"></script>
|
||||
<?php include '../../footer.php';?>
|
|
@ -1,23 +0,0 @@
|
|||
/**
|
||||
* @act icp
|
||||
* @version 1.0
|
||||
* @author youngxj
|
||||
* @date 2018-03-24
|
||||
* @url http://www.youngxj.cn
|
||||
*/
|
||||
|
||||
var cache=getCookie('cache_url');
|
||||
$('#form-control').val(cache);
|
||||
control('单IP 3s/次');
|
||||
$("#btn_state").click(function(){
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.getJSON("https://api.yya.gs/icp_query?domain="+$('.form-control').val()+"&format=json",function(result){
|
||||
if (result.isicp) {
|
||||
setCookie('cache_url',$('.form-control').val(),365);
|
||||
$('.form-controlss').show();
|
||||
$('#content').html('<table class="table table-bordered"><tbody><tr><th scope="row">域名</th><td>'+result.query_domain+'</td></tr><tr><th scope="row">主办方</th><td>'+result.name+'</td></tr><tr><th scope="row">备案类型</th><td>'+result.nature+'</td></tr><tr><th scope="row">主体备案号</th><td>'+result.icp+'</td></tr><tr><th scope="row">ICP备案号</th><td>'+result.nowIcp+'</td></tr><tr><th scope="row">备案地址</th><td>'+result.indexUrl+'</td></tr><tr><th scope="row">网站名称</th><td>'+result.sitename+'</td></tr><tr><th scope="row">备案时间</th><td>'+result.checkDate+'</td></tr></tbody></table>');
|
||||
}else{
|
||||
layer.alert('暂时没有获取到备案信息!');
|
||||
}
|
||||
});
|
||||
});
|
|
@ -1,28 +0,0 @@
|
|||
<?php
|
||||
$id="4";
|
||||
include '../../header.php';?>
|
||||
<div class="container clearfix">
|
||||
<div class="row row-xs">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-10 col-xs-offset-1 col-sm-offset-3 col-md-offset-3 col-lg-offset-3">
|
||||
<div class="page-header">
|
||||
<h3 class="text-center h3-xs"><?php echo $title;?><small class="text-capitalize"><?php echo $subtitle;?></small></h3>
|
||||
</div>
|
||||
<h5 class="text-right"><small><?php echo $explains;?></small></h5>
|
||||
<div class="form-group" id="input-wrap">
|
||||
<label class="control-label control-msg" for="inputContent" copy="Youngxj|杨小杰,admin@youngxj.com"></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" aria-label="..." id="form-control">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" type="button" id="btn_state">启动</button>
|
||||
</div><!-- /btn-group -->
|
||||
</div><!-- /input-group -->
|
||||
</div><!-- /.col-lg-6 -->
|
||||
<div class="form-controlss text-left">
|
||||
<div id="content"></div>
|
||||
<div id="msg"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="icp.php"></script>
|
||||
<?php include '../../footer.php';?>
|
|
@ -1,36 +0,0 @@
|
|||
<?php
|
||||
$id="5";
|
||||
include '../../header.php';?>
|
||||
<?php
|
||||
$ip = real_ip();
|
||||
$url = "https://api.yum6.cn/ip.php?ip=".$ip;
|
||||
$json_string = json_decode(file_get_contents($url),1);
|
||||
$url_tb = "https://api.yum6.cn/ip.php?type=tb&ip=".$ip;
|
||||
$json_string_tb = json_decode(file_get_contents($url_tb),1);
|
||||
$content = '<table class="table table-bordered"><tbody><tr><th scope="row">IP地址</th><td>'.$json_string['ip'].'</td></tr><tr><th scope="row">IP long</th><td>'.$json_string['longip'].'</td></tr><tr><th scope="row">归属地(纯真库)</th><td>'.$json_string['location'].'</td></tr><tr><th scope="row">归属地(淘宝库)</th><td>'.$json_string_tb['location'].'</td></tr><tr><th scope="row">IPv4地址段</th><td>'.$json_string['ipv4'].'</td></tr><tr><th scope="row">网络名称</th><td>'.$json_string['network'].'</td></tr><tr><th scope="row">单位描述</th><td>'.$json_string['company'].'</td></tr></tbody></table>';
|
||||
?>
|
||||
<div class="container clearfix">
|
||||
<div class="row row-xs">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-10 col-xs-offset-1 col-sm-offset-3 col-md-offset-3 col-lg-offset-3">
|
||||
<div class="page-header">
|
||||
<h3 class="text-center h3-xs"><?php echo $title;?><small class="text-capitalize"><?php echo $subtitle;?></small></h3>
|
||||
</div>
|
||||
<h5 class="text-right"><small><?php echo $explains;?></small></h5>
|
||||
<div class="form-group" id="input-wrap">
|
||||
<label class="control-label control-msg" for="inputContent" copy="Youngxj|杨小杰,admin@youngxj.com"></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" aria-label="..." placeholder="IP" value="<?php echo real_ip();?>" onkeyup="value=value.replace(/[^\d\.]/g,'')" id="form-control">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" type="button" id="btn_state">启动</button>
|
||||
</div><!-- /btn-group -->
|
||||
</div><!-- /input-group -->
|
||||
</div><!-- /.col-lg-6 -->
|
||||
<div class="form-controlss text-lefter">
|
||||
<div id="content"><?php echo $content;?></div>
|
||||
<div id="msg"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="ip.php"></script>
|
||||
<?php include '../../footer.php';?>
|
|
@ -1,29 +0,0 @@
|
|||
/**
|
||||
* @act ip
|
||||
* @version 1.0
|
||||
* @author youngxj
|
||||
* @date 2018-03-24
|
||||
* @url http://www.youngxj.cn
|
||||
*/
|
||||
|
||||
var cache=getCookie('cache_ip');
|
||||
$('#form-control').val(cache);
|
||||
control('请输入IP地址:');
|
||||
$("#btn_state").click(function(){
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.getJSON("https://api.yum6.cn/ip.php?ip="+$('.form-control').val(),function(result){
|
||||
$.getJSON("https://api.yum6.cn/ip.php?type=tb&ip="+$('.form-control').val(),function(ret){
|
||||
if(ret.state){
|
||||
var tbk = ret.location;
|
||||
}else{
|
||||
var tbk = '获取失败';
|
||||
}
|
||||
if (result.ip) {
|
||||
setCookie('cache_ip',$('.form-control').val(),365);
|
||||
layer.msg('ok');
|
||||
$('.form-controlss').show();
|
||||
$('#content').html('<table class="table table-bordered"><tbody><tr><th scope="row">IP地址</th><td>'+$('.form-control').val()+'</td></tr><tr><th scope="row">IP long</th><td>'+result.longip+'</td></tr><tr><th scope="row">归属地(纯真库)</th><td>'+result.location+'</td></tr><tr><th scope="row">归属地(淘宝库)</th><td>'+tbk+'</td></tr><tr><th scope="row">IPv4地址段</th><td>'+result.ipv4+'</td></tr><tr><th scope="row">网络名称</th><td>'+result.network+'</td></tr><tr><th scope="row">单位描述</th><td>'+result.company+'</td></tr></tbody></table>');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,101 +0,0 @@
|
|||
<?php
|
||||
$id="30";
|
||||
include '../../header.php';
|
||||
$string = <<<html
|
||||
/* 美化:格式化代码,使之容易阅读 */
|
||||
/* 净化:去掉代码中多余的注释、换行、空格等 */
|
||||
/* 压缩:将代码压缩为更小体积,便于传输 */
|
||||
/* 解压:将压缩后的代码转换为方便阅读的格式 */
|
||||
|
||||
/* 如果有用,请别忘了推荐给你的朋友: */
|
||||
/* javascript在线美化、净化、压缩、解压:http://tools.yum6.cn/js_Format/ */
|
||||
|
||||
/* 只需要复制js代码即可,无需<script>标签 */
|
||||
|
||||
/* 以下是演示代码 */
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "url.php",
|
||||
dataType: "json",
|
||||
cache: false,
|
||||
success: function (data) {
|
||||
alert(data);
|
||||
}
|
||||
});
|
||||
|
||||
html;
|
||||
?>
|
||||
<div class="container clearfix" >
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="form-inline">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div style="min-height:34px;">
|
||||
<div class="form-group">
|
||||
<div id="info" name="info"><p class="text-success">工具准备就绪</p></div>
|
||||
<span>加密层数:
|
||||
<span style="color: red" id="deg">0</span>层</span>
|
||||
<span>处理时间:
|
||||
<span style="color: blue" id="tme">0</span>毫秒</span>
|
||||
<p class="text-danger" id="errmsg"></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 text-right">
|
||||
<p>
|
||||
<select id="compresstype" name="compresstype" class="form-control">
|
||||
<option value="0" selected="">普通压缩</option>
|
||||
<option value="1">加密压缩</option>
|
||||
</select>
|
||||
<select id="tabsize" name="tabsize" class="form-control">
|
||||
<option value="1">制表符缩进</option>
|
||||
<option value="2">2个空格缩进</option>
|
||||
<option value="4" selected="">4个空格缩进</option>
|
||||
<option value="8">8个空格缩进</option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<button class="btn btn-default" id="copycode" type="button" data-clipboard-target='#content'><i class="fa fa-copy"></i> 复制内容</button>
|
||||
<button class="btn btn-warning" id="encode" type="button" title="加密/编码/压缩/Encode/Compress"><i class="fa fa-sign-in"></i> 压缩</button>
|
||||
<button class="btn btn-success" id="decode" type="button" title="解密/解码/格式化/decode/format"><i class="fa fa-sign-out"></i> 解密</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body" style="height:400px;">
|
||||
<textarea style="width:100%;height:100%;" id="content" placeholder="请输入待处理的 js 代码" onfocus="this.select()" rows="15" name="content"><?php if(!isset($string)||$string==''){?><?php }else{echo $string;} ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">工具简介</div>
|
||||
<div class="panel-body">
|
||||
<p>专门解码解密eval(function(p,a,c,k,e,r){})、eval(function(p,a,c,k,e,d){})以及eval(function(h,b,j,f,g,i){})等多种编码加密的代码。 在线格式化Javascript脚本、JS脚本、HTML代码。</p>
|
||||
<p class="text-success">
|
||||
<i class="fa fa-warning"></i> 注:加密前请备份原 JS代码,加密后请测试JS代码能否正常使用。</p>
|
||||
<p class="text-success">
|
||||
<i class="fa fa-external-link"></i> 欢迎使用<a href="http://tools.yum6.cn/run/">前端在线运行测试工具</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var clipboard = new ClipboardJS('#copycode');
|
||||
clipboard.on('success',function(e){
|
||||
e.clearSelection();
|
||||
layer.msg('复制成功!');
|
||||
});
|
||||
clipboard.on('error',function(e){
|
||||
e.clearSelection();
|
||||
layer.msg('复制失败!');
|
||||
});
|
||||
</script>
|
||||
<script src="js/code_packed.js"></script>
|
||||
<script src="js/eval_out.js"></script>
|
||||
<?php include '../../footer.php';?>
|
|
@ -1,517 +0,0 @@
|
|||
function style_html(h, i, f) {
|
||||
var d;
|
||||
d = new
|
||||
function() {
|
||||
this.pos = 0;
|
||||
this.token = "";
|
||||
this.current_mode = "CONTENT";
|
||||
this.tags = {
|
||||
parent: "parent1",
|
||||
parentcount: 1,
|
||||
parent1: ""
|
||||
};
|
||||
this.token_text = this.last_token = this.last_text = this.token_type = this.tag_type = "";
|
||||
this.Utils = {
|
||||
whitespace: "\n\r\t ".split(""),
|
||||
single_token: "br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed".split(","),
|
||||
extra_liners: "head,body,/html".split(","),
|
||||
in_array: function(a, c) {
|
||||
for (var b = 0; b < c.length; b++) if (a === c[b]) return ! 0;
|
||||
return ! 1
|
||||
}
|
||||
};
|
||||
this.get_content = function() {
|
||||
for (var a = "",
|
||||
c = [], b = !1; this.input.charAt(this.pos) !== "<";) {
|
||||
if (this.pos >= this.input.length) return c.length ? c.join("") : ["", "TK_EOF"];
|
||||
a = this.input.charAt(this.pos);
|
||||
this.pos++;
|
||||
this.line_char_count++;
|
||||
if (this.Utils.in_array(a, this.Utils.whitespace)) c.length && (b = !0),
|
||||
this.line_char_count--;
|
||||
else {
|
||||
if (b) {
|
||||
if (this.line_char_count >= this.max_char) {
|
||||
c.push("\n");
|
||||
for (b = 0; b < this.indent_level; b++) c.push(this.indent_string);
|
||||
this.line_char_count = 0
|
||||
} else c.push(" "),
|
||||
this.line_char_count++;
|
||||
b = !1
|
||||
}
|
||||
c.push(a)
|
||||
}
|
||||
}
|
||||
return c.length ? c.join("") : ""
|
||||
};
|
||||
this.get_script = function() {
|
||||
var a = "",
|
||||
c = [];
|
||||
a = RegExp("<\/script>", "igm");
|
||||
a.lastIndex = this.pos;
|
||||
for (var b = (a = a.exec(this.input)) ? a.index: this.input.length; this.pos < b;) {
|
||||
if (this.pos >= this.input.length) return c.length ? c.join("") : ["", "TK_EOF"];
|
||||
a = this.input.charAt(this.pos);
|
||||
this.pos++;
|
||||
c.push(a)
|
||||
}
|
||||
return c.length ? c.join("") : ""
|
||||
};
|
||||
this.record_tag = function(a) {
|
||||
this.tags[a + "count"] ? this.tags[a + "count"]++:this.tags[a + "count"] = 1;
|
||||
this.tags[a + this.tags[a + "count"]] = this.indent_level;
|
||||
this.tags[a + this.tags[a + "count"] + "parent"] = this.tags.parent;
|
||||
this.tags.parent = a + this.tags[a + "count"]
|
||||
};
|
||||
this.retrieve_tag = function(a) {
|
||||
if (this.tags[a + "count"]) {
|
||||
for (var c = this.tags.parent; c;) {
|
||||
if (a + this.tags[a + "count"] === c) break;
|
||||
c = this.tags[c + "parent"]
|
||||
}
|
||||
if (c) this.indent_level = this.tags[a + this.tags[a + "count"]],
|
||||
this.tags.parent = this.tags[c + "parent"];
|
||||
delete this.tags[a + this.tags[a + "count"] + "parent"];
|
||||
delete this.tags[a + this.tags[a + "count"]];
|
||||
this.tags[a + "count"] == 1 ? delete this.tags[a + "count"] : this.tags[a + "count"]--
|
||||
}
|
||||
};
|
||||
this.get_tag = function() {
|
||||
var a = "",
|
||||
c = [],
|
||||
b = !1;
|
||||
do {
|
||||
if (this.pos >= this.input.length) return c.length ? c.join("") : ["", "TK_EOF"];
|
||||
a = this.input.charAt(this.pos);
|
||||
this.pos++;
|
||||
this.line_char_count++;
|
||||
if (this.Utils.in_array(a, this.Utils.whitespace)) b = !0, this.line_char_count--;
|
||||
else {
|
||||
if (a === "'" || a === '"') if (!c[1] || c[1] !== "!") a += this.get_unformatted(a),
|
||||
b = !0;
|
||||
a === "=" && (b = !1);
|
||||
if (c.length && c[c.length - 1] !== "=" && a !== ">" && b) this.line_char_count >= this.max_char ? (this.print_newline(!1, c), this.line_char_count = 0) : (c.push(" "), this.line_char_count++),
|
||||
b = !1;
|
||||
c.push(a)
|
||||
}
|
||||
} while ( a !== ">");
|
||||
a = c.join("");
|
||||
b = a.indexOf(" ") != -1 ? a.indexOf(" ") : a.indexOf(">");
|
||||
b = a.substring(1, b).toLowerCase();
|
||||
a.charAt(a.length - 2) === "/" || this.Utils.in_array(b, this.Utils.single_token) ? this.tag_type = "SINGLE": b === "script" ? (this.record_tag(b), this.tag_type = "SCRIPT") : b === "style" ? (this.record_tag(b), this.tag_type = "STYLE") : b.charAt(0) === "!" ? b.indexOf("[if") != -1 ? (a.indexOf("!IE") != -1 && (a = this.get_unformatted("--\>", a), c.push(a)), this.tag_type = "START") : b.indexOf("[endif") != -1 ? (this.tag_type = "END", this.unindent()) : (a = b.indexOf("[cdata[") != -1 ? this.get_unformatted("]]\>", a) : this.get_unformatted("--\>", a), c.push(a), this.tag_type = "SINGLE") : (b.charAt(0) === "/" ? (this.retrieve_tag(b.substring(1)), this.tag_type = "END") : (this.record_tag(b), this.tag_type = "START"), this.Utils.in_array(b, this.Utils.extra_liners) && this.print_newline(!0, this.output));
|
||||
return c.join("")
|
||||
};
|
||||
this.get_unformatted = function(a, c) {
|
||||
if (c && c.indexOf(a) != -1) return "";
|
||||
var b = "",
|
||||
d = "",
|
||||
f = !0;
|
||||
do {
|
||||
b = this.input.charAt(this.pos);
|
||||
this.pos++;
|
||||
if (this.Utils.in_array(b, this.Utils.whitespace)) {
|
||||
if (!f) {
|
||||
this.line_char_count--;
|
||||
continue
|
||||
}
|
||||
if (b === "\n" || b === "\r") {
|
||||
d += "\n";
|
||||
for (b = 0; b < this.indent_level; b++) d += this.indent_string;
|
||||
f = !1;
|
||||
this.line_char_count = 0;
|
||||
continue
|
||||
}
|
||||
}
|
||||
d += b;
|
||||
this.line_char_count++;
|
||||
f = !0
|
||||
} while ( d . indexOf ( a ) == -1);
|
||||
return d
|
||||
};
|
||||
this.get_token = function() {
|
||||
var a;
|
||||
if (this.last_token === "TK_TAG_SCRIPT") {
|
||||
a = this.get_script();
|
||||
if (typeof a !== "string") return a;
|
||||
a = js_beautify(a, this.indent_size, this.indent_character, this.indent_level);
|
||||
return [a, "TK_CONTENT"]
|
||||
}
|
||||
if (this.current_mode === "CONTENT") return a = this.get_content(),
|
||||
typeof a !== "string" ? a: [a, "TK_CONTENT"];
|
||||
if (this.current_mode === "TAG") return a = this.get_tag(),
|
||||
typeof a !== "string" ? a: [a, "TK_TAG_" + this.tag_type]
|
||||
};
|
||||
this.printer = function(a, c, b, d) {
|
||||
this.input = a || "";
|
||||
this.output = [];
|
||||
this.indent_character = c || " ";
|
||||
this.indent_string = "";
|
||||
this.indent_size = b || 2;
|
||||
this.indent_level = 0;
|
||||
this.max_char = d || 70;
|
||||
for (a = this.line_char_count = 0; a < this.indent_size; a++) this.indent_string += this.indent_character;
|
||||
this.print_newline = function(a, c) {
|
||||
this.line_char_count = 0;
|
||||
if (c && c.length) {
|
||||
if (!a) for (; this.Utils.in_array(c[c.length - 1], this.Utils.whitespace);) c.pop();
|
||||
c.push("\n");
|
||||
for (var b = 0; b < this.indent_level; b++) c.push(this.indent_string)
|
||||
}
|
||||
};
|
||||
this.print_token = function(a) {
|
||||
this.output.push(a)
|
||||
};
|
||||
this.indent = function() {
|
||||
this.indent_level++
|
||||
};
|
||||
this.unindent = function() {
|
||||
this.indent_level > 0 && this.indent_level--
|
||||
}
|
||||
};
|
||||
return this
|
||||
};
|
||||
for (d.printer(h, f, i);;) {
|
||||
h = d.get_token();
|
||||
d.token_text = h[0];
|
||||
d.token_type = h[1];
|
||||
if (d.token_type === "TK_EOF") break;
|
||||
switch (d.token_type) {
|
||||
case "TK_TAG_START":
|
||||
case "TK_TAG_SCRIPT":
|
||||
case "TK_TAG_STYLE":
|
||||
d.print_newline(!1, d.output);
|
||||
d.print_token(d.token_text);
|
||||
d.indent();
|
||||
d.current_mode = "CONTENT";
|
||||
break;
|
||||
case "TK_TAG_END":
|
||||
d.print_newline(!0, d.output);
|
||||
d.print_token(d.token_text);
|
||||
d.current_mode = "CONTENT";
|
||||
break;
|
||||
case "TK_TAG_SINGLE":
|
||||
d.print_newline(!1, d.output);
|
||||
d.print_token(d.token_text);
|
||||
d.current_mode = "CONTENT";
|
||||
break;
|
||||
case "TK_CONTENT":
|
||||
d.token_text !== "" && (d.print_newline(!1, d.output), d.print_token(d.token_text)),
|
||||
d.current_mode = "TAG"
|
||||
}
|
||||
d.last_token = d.token_type;
|
||||
d.last_text = d.token_text
|
||||
}
|
||||
return d.output.join("")
|
||||
}
|
||||
|
||||
function js_beautify(h, i, f, d) {
|
||||
function a() {
|
||||
for (; l.length && (l[l.length - 1] === " " || l[l.length - 1] === t);) l.pop()
|
||||
}
|
||||
|
||||
function c(c) {
|
||||
c = typeof c === "undefined" ? !0 : c;
|
||||
a();
|
||||
if (l.length) { (l[l.length - 1] !== "\n" || !c) && l.push("\n");
|
||||
for (c = 0; c < d; c++) l.push(t)
|
||||
}
|
||||
}
|
||||
|
||||
function b() {
|
||||
var a = l.length ? l[l.length - 1] : " ";
|
||||
a !== " " && a !== "\n" && a !== t && l.push(" ")
|
||||
}
|
||||
|
||||
function m() {
|
||||
l.push(k)
|
||||
}
|
||||
|
||||
function A() {
|
||||
x = o === "DO_BLOCK";
|
||||
o = v.pop()
|
||||
}
|
||||
|
||||
function q(a, c) {
|
||||
for (var b = 0; b < c.length; b++) if (c[b] === a) return ! 0;
|
||||
return ! 1
|
||||
}
|
||||
|
||||
function B() {
|
||||
var a = 0,
|
||||
b = "";
|
||||
do {
|
||||
if (e >= j.length) return ["", "TK_EOF"];
|
||||
b = j.charAt(e);
|
||||
e += 1;
|
||||
b === "\n" && (a += 1)
|
||||
} while ( q ( b , C ));
|
||||
if (a > 1) for (var d = 0; d < 2; d++) c(d === 0);
|
||||
a = a === 1;
|
||||
if (q(b, y)) {
|
||||
if (e < j.length) for (; q(j.charAt(e), y);) if (b += j.charAt(e), e += 1, e === j.length) break;
|
||||
if (e !== j.length && b.match(/^[0-9]+[Ee]$/) && j.charAt(e) === "-") return e += 1,
|
||||
a = B(e),
|
||||
b += "-" + a[0],
|
||||
[b, "TK_WORD"];
|
||||
if (b === "in") return [b, "TK_OPERATOR"];
|
||||
return [b, "TK_WORD"]
|
||||
}
|
||||
if (b === "(" || b === "[") return [b, "TK_START_EXPR"];
|
||||
if (b === ")" || b === "]") return [b, "TK_END_EXPR"];
|
||||
if (b === "{") return [b, "TK_START_BLOCK"];
|
||||
if (b === "}") return [b, "TK_END_BLOCK"];
|
||||
if (b === ";") return [b, "TK_END_COMMAND"];
|
||||
if (b === "/") {
|
||||
d = "";
|
||||
if (j.charAt(e) === "*") {
|
||||
e += 1;
|
||||
if (e < j.length) for (; ! (j.charAt(e) === "*" && j.charAt(e + 1) && j.charAt(e + 1) === "/") && e < j.length;) if (d += j.charAt(e), e += 1, e >= j.length) break;
|
||||
e += 2;
|
||||
return ["/*" + d + "*/", "TK_BLOCK_COMMENT"]
|
||||
}
|
||||
if (j.charAt(e) === "/") {
|
||||
for (d = b; j.charAt(e) !== "\r" && j.charAt(e) !== "\n";) if (d += j.charAt(e), e += 1, e >= j.length) break;
|
||||
e += 1;
|
||||
a && c();
|
||||
return [d, "TK_COMMENT"]
|
||||
}
|
||||
}
|
||||
if (b === "'" || b === '"' || b === "/" && (g === "TK_WORD" && p === "return" || g === "TK_START_EXPR" || g === "TK_END_BLOCK" || g === "TK_OPERATOR" || g === "TK_EOF" || g === "TK_END_COMMAND")) {
|
||||
a = b;
|
||||
d = !1;
|
||||
b = "";
|
||||
if (e < j.length) for (; d || j.charAt(e) !== a;) if (b += j.charAt(e), d = d ? !1 : j.charAt(e) === "\\", e += 1, e >= j.length) break;
|
||||
e += 1;
|
||||
g === "TK_END_COMMAND" && c();
|
||||
return [a + b + a, "TK_STRING"]
|
||||
}
|
||||
if (q(b, z)) {
|
||||
for (; e < j.length && q(b + j.charAt(e), z);) if (b += j.charAt(e), e += 1, e >= j.length) break;
|
||||
return [b, "TK_OPERATOR"]
|
||||
}
|
||||
return [b, "TK_UNKNOWN"]
|
||||
}
|
||||
var j, l, k, g, p, o, v, t, C, y, z, e, n, r, x, s, w;
|
||||
f = f || " ";
|
||||
i = i || 4;
|
||||
for (t = ""; i--;) t += f;
|
||||
j = h;
|
||||
h = "";
|
||||
g = "TK_START_EXPR";
|
||||
p = "";
|
||||
l = [];
|
||||
w = s = x = !1;
|
||||
C = "\n\r\t ".split("");
|
||||
y = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$".split("");
|
||||
z = "+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! !! , : ? ^ ^= |=".split(" ");
|
||||
i = "continue,try,throw,return,var,if,switch,case,default,for,while,break,function".split(",");
|
||||
o = "BLOCK";
|
||||
v = [o];
|
||||
d = d || 0;
|
||||
e = 0;
|
||||
for (f = !1;;) {
|
||||
r = B(e);
|
||||
k = r[0];
|
||||
r = r[1];
|
||||
if (r === "TK_EOF") break;
|
||||
switch (r) {
|
||||
case "TK_START_EXPR":
|
||||
s = !1;
|
||||
v.push(o);
|
||||
o = "EXPRESSION";
|
||||
g === "TK_END_EXPR" || g === "TK_START_EXPR" || (g !== "TK_WORD" && g !== "TK_OPERATOR" ? b() : q(h, i) && h !== "function" && b());
|
||||
m();
|
||||
break;
|
||||
case "TK_END_EXPR":
|
||||
m();
|
||||
A();
|
||||
break;
|
||||
case "TK_START_BLOCK":
|
||||
h === "do" ? (v.push(o), o = "DO_BLOCK") : (v.push(o), o = "BLOCK");
|
||||
g !== "TK_OPERATOR" && g !== "TK_START_EXPR" && (g === "TK_START_BLOCK" ? c() : b());
|
||||
m();
|
||||
d++;
|
||||
break;
|
||||
case "TK_END_BLOCK":
|
||||
g === "TK_START_BLOCK" ? (a(), d && d--) : (d && d--, c());
|
||||
m();
|
||||
A();
|
||||
break;
|
||||
case "TK_WORD":
|
||||
if (x) {
|
||||
b();
|
||||
m();
|
||||
b();
|
||||
break
|
||||
}
|
||||
if (k === "case" || k === "default") {
|
||||
p === ":" ? l.length && l[l.length - 1] === t && l.pop() : (d && d--, c(), d++);
|
||||
m();
|
||||
f = !0;
|
||||
break
|
||||
}
|
||||
n = "NONE";
|
||||
g === "TK_END_BLOCK" ? q(k.toLowerCase(), ["else", "catch", "finally"]) ? (n = "SPACE", b()) : n = "NEWLINE": g === "TK_END_COMMAND" && (o === "BLOCK" || o === "DO_BLOCK") ? n = "NEWLINE": g === "TK_END_COMMAND" && o === "EXPRESSION" ? n = "SPACE": g === "TK_WORD" ? n = "SPACE": g === "TK_START_BLOCK" ? n = "NEWLINE": g === "TK_END_EXPR" && (b(), n = "NEWLINE");
|
||||
if (g !== "TK_END_BLOCK" && q(k.toLowerCase(), ["else", "catch", "finally"])) c();
|
||||
else if (q(k, i) || n === "NEWLINE") if (p === "else") b();
|
||||
else {
|
||||
if (! ((g === "TK_START_EXPR" || p === "=") && k === "function")) if (g === "TK_WORD" && (p === "return" || p === "throw")) b();
|
||||
else if (g !== "TK_END_EXPR") {
|
||||
if ((g !== "TK_START_EXPR" || k !== "var") && p !== ":") k === "if" && g === "TK_WORD" && h === "else" ? b() : c()
|
||||
} else q(k, i) && p !== ")" && c()
|
||||
} else n === "SPACE" && b();
|
||||
m();
|
||||
h = k;
|
||||
k === "var" && (s = !0, w = !1);
|
||||
break;
|
||||
case "TK_END_COMMAND":
|
||||
m();
|
||||
s = !1;
|
||||
break;
|
||||
case "TK_STRING":
|
||||
g === "TK_START_BLOCK" || g === "TK_END_BLOCK" ? c() : g === "TK_WORD" && b();
|
||||
m();
|
||||
break;
|
||||
case "TK_OPERATOR":
|
||||
var u = n = !0;
|
||||
s && k !== "," && (w = !0, k === ":" && (s = !1));
|
||||
if (k === ":" && f) {
|
||||
m();
|
||||
c();
|
||||
break
|
||||
}
|
||||
f = !1;
|
||||
if (k === ",") {
|
||||
s ? w ? (m(), c(), w = !1) : (m(), b()) : g === "TK_END_BLOCK" ? (m(), c()) : o === "BLOCK" ? (m(), c()) : (m(), b());
|
||||
break
|
||||
} else k === "--" || k === "++" ? (n = p === ";" ? !0 : !1, u = !1) : k === "!" && g === "TK_START_EXPR" ? u = n = !1 : g === "TK_OPERATOR" ? u = n = !1 : g === "TK_END_EXPR" ? u = n = !0 : k === "." ? u = n = !1 : k === ":" && (n = p.match(/^\d+$/) ? !0 : !1);
|
||||
n && b();
|
||||
m();
|
||||
u && b();
|
||||
break;
|
||||
case "TK_BLOCK_COMMENT":
|
||||
c();
|
||||
m();
|
||||
c();
|
||||
break;
|
||||
case "TK_COMMENT":
|
||||
b();
|
||||
m();
|
||||
c();
|
||||
break;
|
||||
case "TK_UNKNOWN":
|
||||
m()
|
||||
}
|
||||
g = r;
|
||||
p = k
|
||||
}
|
||||
return l.join("")
|
||||
}
|
||||
|
||||
function do_js_beautify() {
|
||||
js_source = $("#content").val().replace(/^\s+/, "");
|
||||
tabsize = $("#tabsize option:selected").val();
|
||||
tabchar = " ";
|
||||
tabsize == 1 && (tabchar = "\t");
|
||||
js_source && js_source.charAt(0) === "<" ? $("#content").val(style_html(js_source, tabsize, tabchar, 80)) : $("#content").val(js_beautify(js_source, tabsize, tabchar));
|
||||
return ! 1
|
||||
}
|
||||
|
||||
// 清除输出信息
|
||||
function clearinfo() {
|
||||
$("#info").html('');
|
||||
}
|
||||
|
||||
// 加载一条输出信息
|
||||
function addinfo(h, i) {
|
||||
switch (i) {
|
||||
case 1:
|
||||
// 信息
|
||||
$("#info").append('<p class="text-info">' + h + '</p>');
|
||||
break;
|
||||
case 2:
|
||||
// 失败
|
||||
$("#info").append('<p class="text-danger">' + h + '</p>');
|
||||
break;
|
||||
case 3:
|
||||
// 加密完成
|
||||
$("#info").append('<p class="text-success">' + h + '</p>');
|
||||
break;
|
||||
default:
|
||||
// 普通信息
|
||||
$("#info").append('<p class="">' + h + '</p>');
|
||||
}
|
||||
}
|
||||
|
||||
onDecodeClick = function() {
|
||||
try {
|
||||
var h = (new Date).getTime();
|
||||
clearinfo();
|
||||
addinfo("初始化解码成功");
|
||||
var i = /^ *eval *\(/ig,
|
||||
f = $("#content"),
|
||||
d = $("#decode"),
|
||||
a = $("#deg"),
|
||||
c = 0;
|
||||
$("#errmsg").html('');
|
||||
a.html('0');
|
||||
$("#tme").html('0');
|
||||
for (d.attr('disabled', "true"); i.test(f.val()) && c < 20;) addinfo("正在解码第" + (c + 1) + "次..."),
|
||||
f.val(eval(f.val().replace(i, "(function(){ return (") + "})()")),
|
||||
c++;
|
||||
i.test(f.val()) ? (addinfo("解码失败,已经经过" + c + "次尝试", 2), $("#errmsg").html("非常遗憾,解码失败。")) : (c > 0 ? addinfo("解码完成,共解码" + c + "次", 3) : addinfo("原文似乎没有编码,不需要解码", 3), addinfo("正在以" + ($("#tabsize option:selected").val() == 1 ? "制表符": $("#tabsize option:selected").val() + "空格") + "缩进格式化源码..."), do_js_beautify(), addinfo("格式化完成"));
|
||||
a.html(c);
|
||||
} catch(b) {
|
||||
addinfo("解码失败,过程发生错误: " + b.message, 2),
|
||||
$("#errmsg").html("发生错误:" + b.message);
|
||||
}
|
||||
d.removeAttr("disabled");
|
||||
i = (new Date).getTime();
|
||||
h = Math.floor(i - h);
|
||||
addinfo("所有任务完成,共耗时" + h + "毫秒", 1);
|
||||
$("#tme").html(h);
|
||||
};
|
||||
|
||||
function pack_js(h) {
|
||||
var i = $("#content").val(),
|
||||
f = new Packer;
|
||||
h = h ? f.pack(i, 1, 0) : f.pack(i, 0, 0);
|
||||
$("#content").val(h);
|
||||
}
|
||||
onEncodeClick = function() {
|
||||
try {
|
||||
var h = (new Date).getTime();
|
||||
var types = $("#compresstype option:selected").val(); // 编码类型
|
||||
clearinfo(); // 清除之前日志
|
||||
addinfo("初始化编码成功");
|
||||
$("#errmsg").html('');
|
||||
$("#deg").html('0');
|
||||
$("#tme").html('0');
|
||||
|
||||
addinfo("正在以" + (types == "1" ? " Dean Edwards Packer ": "普通") + "方式编码");
|
||||
pack_js(types == "1");
|
||||
addinfo("编码完成", 3)
|
||||
} catch(i) {
|
||||
addinfo("编码失败,过程发生错误: " + i.message, 2),
|
||||
$("#errmsg").html("发生错误:" + i.message);
|
||||
}
|
||||
|
||||
var f = (new Date).getTime();
|
||||
h = Math.floor(f - h);
|
||||
addinfo("所有任务完成,共耗时" + h + "毫秒", 1);
|
||||
$("#tme").html(h);
|
||||
};
|
||||
|
||||
$(function() {
|
||||
// 加密
|
||||
$("#encode").click(function() {
|
||||
onEncodeClick();
|
||||
});
|
||||
|
||||
$("#decode").click(function() {
|
||||
onDecodeClick();
|
||||
});
|
||||
|
||||
clearinfo();
|
||||
addinfo('工具准备就绪', 3);
|
||||
});
|
|
@ -1,318 +0,0 @@
|
|||
<?php
|
||||
$id="43";
|
||||
include '../../header.php';
|
||||
?>
|
||||
<!--该工具由ITool.Club提供-->
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
<div id="compiler" class="panel-heading">
|
||||
<form class="form-inline" role="form">
|
||||
<label><strong style="font-size: 16px"><i class="fa fa-cogs"></i> 正则表达式在线测试</strong></label>
|
||||
<button type="button" class="btn btn-success" data-toggle="modal" data-target="#myModal" id="submitBTN"><i class="fa fa-send-o"></i> 生成代码</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-danger" style="display: none;"></div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<textarea rows="6" id="textSour" placeholder="在此输入待匹配文本" class="form-control"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12" style="font-size:14px;padding-top: 12px;">
|
||||
|
||||
<form class="form-inline">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="email">正则表达式:</label>
|
||||
<input type="text" id="textPattern" placeholder="在此输入正则表达式" class="form-control">
|
||||
</div>
|
||||
<div class="checkbox"><label><input type="checkbox" value="global" checked="checked" id="optionGlobal" name="optionGlobl">全局搜索</label></div>
|
||||
<div class="checkbox"><label><input type="checkbox" value="ignoreCase" id="optionIgnoreCase" name="optionIgnoreCase">忽略大小写</label></div>
|
||||
<div class="form-group"><label><a class="btn btn-success" onclick="return onMatch();">测试匹配</a></label></div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12" style="font-size:14px;padding-top: 12px;" >
|
||||
<textarea rows="6" readonly="readonly" placeholder="匹配结果..." id="textMatchResult" class="form-control"></textarea>
|
||||
</div>
|
||||
<div class="col-md-12" style="font-size:14px;padding-top: 12px;">
|
||||
<form class="form-inline">
|
||||
<div class="form-group">
|
||||
<label for="email">替换文本:</lable>
|
||||
<input type="text" id="textReplace" name="textReplace" class="form-control" placeholder="在此输入替换文本">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<a onclick="return onReplace()" class="btn btn-warning"><i class="icon-chevron-down icon-white"></i>替换</a>
|
||||
</label>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-12" style="font-size:14px;padding-top: 12px;">
|
||||
<textarea rows="6" readonly="readonly" id="textReplaceResult" class="form-control" placeholder="替换结果..." ></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>.panel-body{word-wrap: break-word;}</style>
|
||||
<div class="col-md-12">
|
||||
<div id="about" class="panel panel-default">
|
||||
<div class="panel-heading">常用正则表达式</div>
|
||||
<div class="panel-body">
|
||||
<h2>一、校验数字的表达式</h2>
|
||||
<ul>
|
||||
<li>数字:<strong>^[0-9]*$</strong></li>
|
||||
<li>n位的数字:<strong>^\d{n}$</strong></li>
|
||||
<li>至少n位的数字<strong>:^\d{n,}$</strong></li>
|
||||
<li>m-n位的数字:<strong>^\d{m,n}$</strong></li>
|
||||
<li>零和非零开头的数字:<strong>^(0|[1-9][0-9]*)$</strong></li>
|
||||
<li>非零开头的最多带两位小数的数字:<strong>^([1-9][0-9]*)+(\.[0-9]{1,2})?$</strong></li>
|
||||
<li>带1-2位小数的正数或负数:<strong>^(\-)?\d+(\.\d{1,2})$</strong></li>
|
||||
<li>正数、负数、和小数:<strong>^(\-|\+)?\d+(\.\d+)?$</strong></li>
|
||||
<li>有两位小数的正实数:<strong>^[0-9]+(\.[0-9]{2})?$</strong></li>
|
||||
<li>有1~3位小数的正实数:<strong>^[0-9]+(\.[0-9]{1,3})?$</strong></li>
|
||||
<li>非零的正整数:<strong>^[1-9]\d*$ 或 ^([1-9][0-9]*){1,3}$ 或 ^\+?[1-9][0-9]*$</strong></li>
|
||||
<li>非零的负整数:<strong>^\-[1-9][]0-9"*$ 或 ^-[1-9]\d*$</strong></li>
|
||||
<li>非负整数:<strong>^\d+$ 或 ^[1-9]\d*|0$</strong></li>
|
||||
<li>非正整数:<strong>^-[1-9]\d*|0$ 或 ^((-\d+)|(0+))$</strong></li>
|
||||
<li>非负浮点数:<strong>^\d+(\.\d+)?$ 或 ^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$</strong></li>
|
||||
<li>非正浮点数:<strong>^((-\d+(\.\d+)?)|(0+(\.0+)?))$ 或 ^(-([1-9]\d*\.\d*|0\.\d*[1-9]\d*))|0?\.0+|0$</strong></li>
|
||||
<li>正浮点数:<strong>^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$ 或 ^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$</strong></li>
|
||||
<li>负浮点数:<strong>^-([1-9]\d*\.\d*|0\.\d*[1-9]\d*)$ 或 ^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$</strong></li>
|
||||
<li>浮点数:<strong>^(-?\d+)(\.\d+)?$ 或 ^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$</strong></li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<h2>二、校验字符的表达式</h2>
|
||||
<ul>
|
||||
<li>汉字:<strong>^[\u4e00-\u9fa5]{0,}$</strong></li>
|
||||
<li>英文和数字:<strong>^[A-Za-z0-9]+$ 或 ^[A-Za-z0-9]{4,40}$</strong></li>
|
||||
<li>长度为3-20的所有字符:<strong>^.{3,20}$</strong></li>
|
||||
<li>由26个英文字母组成的字符串:<strong>^[A-Za-z]+$</strong></li>
|
||||
<li>由26个大写英文字母组成的字符串:<strong>^[A-Z]+$</strong></li>
|
||||
<li>由26个小写英文字母组成的字符串:<strong>^[a-z]+$</strong></li>
|
||||
<li>由数字和26个英文字母组成的字符串:<strong>^[A-Za-z0-9]+$</strong></li>
|
||||
<li>由数字、26个英文字母或者下划线组成的字符串:<strong>^\w+$ 或 ^\w{3,20}$</strong></li>
|
||||
<li>中文、英文、数字包括下划线:<strong>^[\u4E00-\u9FA5A-Za-z0-9_]+$</strong></li>
|
||||
<li>中文、英文、数字但不包括下划线等符号:<strong>^[\u4E00-\u9FA5A-Za-z0-9]+$ 或 ^[\u4E00-\u9FA5A-Za-z0-9]{2,20}$</strong></li>
|
||||
<li>可以输入含有^%&',;=?$\"等字符:<strong>[^%&',;=?$\x22]+</strong></li>
|
||||
<li>禁止输入含有~的字符:<strong>[^~\x22]+</strong></li>
|
||||
</ul>
|
||||
<hr>
|
||||
<h2>三、特殊需求表达式</h2>
|
||||
<ul>
|
||||
<li>Email地址:<strong>^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$</strong></li>
|
||||
<li>域名:<strong>[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(/.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+/.?</strong></li>
|
||||
<li>InternetURL:<strong>[a-zA-z]+://[^\s]* 或 ^http://([\w-]+\.)+[\w-]+(/[\w-./?%&=]*)?$</strong></li>
|
||||
<li>手机号码:<strong>^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$</strong></li>
|
||||
<li>电话号码("XXX-XXXXXXX"、"XXXX-XXXXXXXX"、"XXX-XXXXXXX"、"XXX-XXXXXXXX"、"XXXXXXX"和"XXXXXXXX):<strong>^(\(\d{3,4}-)|\d{3.4}-)?\d{7,8}$ </strong></li>
|
||||
<li>国内电话号码(0511-4405222、021-87888822):<strong>\d{3}-\d{8}|\d{4}-\d{7}</strong>
|
||||
</li>
|
||||
<li>电话号码正则表达式(支持手机号码,3-4位区号,7-8位直播号码,1-4位分机号): <strong>((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)</strong></li>
|
||||
<li>身份证号(15位、18位数字),最后一位是校验位,可能为数字或字符X:<strong>(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)</strong></li>
|
||||
<li>帐号是否合法(字母开头,允许5-16字节,允许字母数字下划线):<strong>^[a-zA-Z][a-zA-Z0-9_]{4,15}$</strong></li>
|
||||
<li>密码(以字母开头,长度在6~18之间,只能包含字母、数字和下划线):<strong>^[a-zA-Z]\w{5,17}$</strong></li>
|
||||
<li>强密码(必须包含大小写字母和数字的组合,不能使用特殊字符,长度在8-10之间):<strong>^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,10}$ </strong></li>
|
||||
<li>日期格式:<strong>^\d{4}-\d{1,2}-\d{1,2}</strong></li>
|
||||
<li>一年的12个月(01~09和1~12):<strong>^(0?[1-9]|1[0-2])$</strong></li>
|
||||
<li>一个月的31天(01~09和1~31):<strong>^((0?[1-9])|((1|2)[0-9])|30|31)$ </strong></li>
|
||||
<li>钱的输入格式:
|
||||
<ol>
|
||||
<li>有四种钱的表示形式我们可以接受:"10000.00" 和 "10,000.00", 和没有 "分" 的 "10000" 和 "10,000":<strong>^[1-9][0-9]*$ </strong></li>
|
||||
<li>这表示任意一个不以0开头的数字,但是,这也意味着一个字符"0"不通过,所以我们采用下面的形式:<strong>^(0|[1-9][0-9]*)$ </strong></li><li>
|
||||
一个0或者一个不以0开头的数字.我们还可以允许开头有一个负号:<strong>^(0|-?[1-9][0-9]*)$ </strong></li>
|
||||
<li>这表示一个0或者一个可能为负的开头不为0的数字.让用户以0开头好了.把负号的也去掉,因为钱总不能是负的吧。下面我们要加的是说明可能的小数部分:<strong>^[0-9]+(.[0-9]+)?$ </strong></li>
|
||||
<li>必须说明的是,小数点后面至少应该有1位数,所以"10."是不通过的,但是 "10" 和 "10.2" 是通过的:<strong>^[0-9]+(.[0-9]{2})?$ </strong></li>
|
||||
<li>这样我们规定小数点后面必须有两位,如果你认为太苛刻了,可以这样:<strong>^[0-9]+(.[0-9]{1,2})?$ </strong></li>
|
||||
<li>这样就允许用户只写一位小数.下面我们该考虑数字中的逗号了,我们可以这样:<strong>^[0-9]{1,3}(,[0-9]{3})*(.[0-9]{1,2})?$ </strong></li>
|
||||
<li>1到3个数字,后面跟着任意个 逗号+3个数字,逗号成为可选,而不是必须:<strong>^([0-9]+|[0-9]{1,3}(,[0-9]{3})*)(.[0-9]{1,2})?$ </strong></li>
|
||||
<li>备注:这就是最终结果了,别忘了"+"可以用"*"替代如果你觉得空字符串也可以接受的话(奇怪,为什么?)最后,别忘了在用函数时去掉去掉那个反斜杠,一般的错误都在这里</li></ol></li>
|
||||
<li>xml文件:<strong>^([a-zA-Z]+-?)+[a-zA-Z0-9]+\\.[x|X][m|M][l|L]$</strong></li>
|
||||
<li>中文字符的正则表达式:<strong>[\u4e00-\u9fa5]</strong></li>
|
||||
<li>双字节字符:<strong>[^\x00-\xff] (包括汉字在内,可以用来计算字符串的长度(一个双字节字符长度计2,ASCII字符计1))</strong></li>
|
||||
<li>空白行的正则表达式:<strong>\n\s*\r (可以用来删除空白行)</strong></li>
|
||||
<li>HTML标记的正则表达式:<strong><(\S*?)[^>]*>.*?</\1>|<.*? /> (
|
||||
首尾空白字符的正则表达式:^\s*|\s*$或(^\s*)|(\s*$) (可以用来删除行首行尾的空白字符(包括空格、制表符、换页符等等),非常有用的表达式)</strong></li>
|
||||
<li>腾讯QQ号:<strong>[1-9][0-9]{4,} (腾讯QQ号从10000开始)</strong></li>
|
||||
<li>中国邮政编码:<strong>[1-9]\d{5}(?!\d) (中国邮政编码为6位数字)</strong></li>
|
||||
<li>IP地址:<strong>((?:(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)) </strong></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 模态框(Modal) -->
|
||||
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
|
||||
<h4 class="modal-title" id="myModalLabel">各语言代码参考</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="alert alert-danger" id="alert-message"></div>
|
||||
<div id="languagelist">
|
||||
<h4>JavaScript - JavaScript 正则表达式</a></h4>
|
||||
<pre id="js"></pre>
|
||||
|
||||
<h4>PHP</h4>
|
||||
<pre id="php"></pre>
|
||||
|
||||
<h4>Go</h4>
|
||||
<pre id="go"></pre>
|
||||
|
||||
<h4>JAVA - Java 正则表达式</a></h4>
|
||||
<pre id="java"></pre>
|
||||
|
||||
<h4>Ruby - Ruby 正则表达式</a></h4>
|
||||
<pre id="rb"></pre>
|
||||
|
||||
<h4>Python - Python 正则表达式</a></h4>
|
||||
<pre id="py"></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal -->
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function setVisible(idElement, visible) {
|
||||
var obj = document.getElementById(idElement);
|
||||
obj.style.visibility = visible ? "visible" : "hidden";
|
||||
}
|
||||
function isValidFields() {
|
||||
var textSour = document.getElementById("textSour");
|
||||
if (null==textSour.value || textSour.value.length<1) {
|
||||
textSour.focus();
|
||||
$(".alert-danger").html("请输入待匹配文本").show().delay(5000).fadeOut();
|
||||
return false;
|
||||
}
|
||||
var textPattern = document.getElementById("textPattern");
|
||||
if (null==textPattern.value || textPattern.value.length<1) {
|
||||
textPattern.focus();
|
||||
$(".alert-danger").html("请输入正则表达式").show().delay(5000).fadeOut();
|
||||
return false;
|
||||
}
|
||||
$(".alert-danger").hide();
|
||||
return true;
|
||||
}
|
||||
function buildRegex() {
|
||||
var op = "";
|
||||
if (document.getElementById("optionGlobal").checked)op = "g";
|
||||
if (document.getElementById("optionIgnoreCase").checked)op = op + "i";
|
||||
return new RegExp(document.getElementById("textPattern").value, op);
|
||||
}
|
||||
function onMatch() {
|
||||
if (!isValidFields())
|
||||
return false;
|
||||
document.getElementById("textMatchResult").value = "";
|
||||
var regex = buildRegex();
|
||||
var result = document.getElementById("textSour").value.match(regex);
|
||||
if (null==result || 0==result.length) {
|
||||
document.getElementById("textMatchResult").value = "(没有匹配)";
|
||||
return false;
|
||||
}
|
||||
if (document.getElementById("optionGlobal").checked) {
|
||||
var strResult = "共找到 " + result.length + " 处匹配:\r\n";
|
||||
for (var i=0;i < result.length;++i)strResult = strResult + result[i] + "\r\n";
|
||||
document.getElementById("textMatchResult").value = strResult;
|
||||
}
|
||||
else {
|
||||
document.getElementById("textMatchResult").value= "匹配位置:" + regex.lastIndex + "\r\n匹配结果:" + result[0];
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function onReplace() {
|
||||
var str = document.getElementById("textSour").value;
|
||||
var regex = buildRegex();
|
||||
document.getElementById("textReplaceResult").value= str.replace(regex, document.getElementById("textReplace").value);
|
||||
}
|
||||
function reset(){
|
||||
$("#textSour").val("");
|
||||
$("#textPattern").val("");
|
||||
$("#textMatchResult").val("");
|
||||
$("#textReplace").val("");
|
||||
$("#textReplaceResult").val("");
|
||||
}
|
||||
String.prototype.format = function (args) {
|
||||
if (arguments.length > 0) {
|
||||
var result = this;
|
||||
if (arguments.length == 1 && typeof (args) == "object") {
|
||||
for (var key in args) {
|
||||
var reg = new RegExp("({" + key + "})", "g");
|
||||
result = result.replace(reg, args[key]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
if (arguments[i] == undefined) {
|
||||
result = result.replace(reg, arguments[i]);
|
||||
}
|
||||
else {
|
||||
var reg = new RegExp('\\{' + i + '\\}', 'gm'); ;
|
||||
result = result.replace(reg, arguments[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
var languageCode = {
|
||||
js: "var pattern = /{0}/,\n\tstr = '{1}';\nconsole.log(pattern.test(str));",
|
||||
php: "$str = '{1}';\n$isMatched = preg_match('/{0}/', $str, $matches);\nvar_dump($isMatched, $matches);",
|
||||
py: "import re\npattern = re.compile(ur'{0}')\nstr = u'{1}'\nprint(pattern.search(str))",
|
||||
java: "import java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\npublic class RegexMatches {\n\t\n\tpublic static void main(String args[]) {\n\t\tString str = \"{1}\";\n\t\tString pattern = \"{0}\";\n\n\t\tPattern r = Pattern.compile(pattern);\n\t\tMatcher m = r.matcher(str);\n\t\tSystem.out.println(m.matches());\n\t}\n\n}",
|
||||
go: "package main\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n)\n\nfunc main() {\n\tstr := \"{1}\"\n\tmatched, err := regexp.MatchString(\"{0}\", str)\n\tfmt.Println(matched, err)\n}",
|
||||
rb: "pattern = /{0}/\nstr = '{1}'\np pattern.match(str)"
|
||||
};
|
||||
$(document).ready(function (){
|
||||
$("#right_area li a").click(function (){
|
||||
$("#textPattern").val($(this).attr("title"));
|
||||
onMatch();
|
||||
});
|
||||
$('#myModal').on('show.bs.modal', function () {
|
||||
|
||||
|
||||
var pattern = $("#textPattern").val();
|
||||
if (!pattern) {
|
||||
$("#alert-message").html("你还没输入正则表达式").show();
|
||||
} else {
|
||||
$("#alert-message").hide();
|
||||
}
|
||||
var prelist = $("#languagelist pre");
|
||||
for (var i = 0; i < prelist.length; i++) {
|
||||
var pre = $(prelist[i]);
|
||||
var language = pre.attr("id");
|
||||
if (language == 'go' || language == 'java') {
|
||||
pattern2 = pattern.replace(/\\/gi, "\\\\");
|
||||
pre.html(languageCode[language].format(pattern2, ""));
|
||||
} else {
|
||||
pre.html(languageCode[language].format(pattern, ""));
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php include '../../footer.php';?>
|
|
@ -1,124 +0,0 @@
|
|||
<?php
|
||||
$id = '45';
|
||||
include '../../header.php';
|
||||
?>
|
||||
<link href="res/base.css" rel="stylesheet">
|
||||
|
||||
<header class="header">
|
||||
|
||||
</header>
|
||||
|
||||
<main class="row-fluid">
|
||||
<div class="col-md-5" style="padding:0;">
|
||||
<textarea id="json-src" placeholder="在此输入json字符串或XML字符串..." class="form-control adapter_height form-control" style="padding:20px;border:0;border-right:solid 1px #ddd;border-bottom:solid 1px #ddd;border-radius:0;resize: none; outline:none;">
|
||||
{"code":"1","state":200}</textarea>
|
||||
</div>
|
||||
<div class="col-md-7" style="padding:0;">
|
||||
<div style="padding:7px;font-size:16px;border-bottom:solid 1px #ddd;" class="navi">
|
||||
<a href="#" class="zip" title="压缩" data-placement="bottom"><i class="fa fa-database"></i></a>
|
||||
<a href="#" class="xml" title="转XML" data-placement="bottom"><i class="fa fa-file-excel-o"></i></a>
|
||||
<a href="#" class="" style="color:#15b374;cursor:no-drop;" title="染色" data-placement="bottom"><i class="fa fa-flask"></i></a>
|
||||
<a href="#" class="clear" title="清空" data-placement="bottom"><i class="fa fa-trash"></i></a>
|
||||
</div>
|
||||
<div id="json-target" class="adapter_height form-control" style="padding:20px;border-right:solid 1px #ddd;border-bottom:solid 1px #ddd;border-radius:0;resize: none;overflow-y:scroll; outline:none;">
|
||||
</div>
|
||||
<form id="form-save" method="POST"><input type="hidden" value="" id="txt-content" name="content"></form>
|
||||
</div>
|
||||
</main>
|
||||
<script src="res/jquery.json.js"></script>
|
||||
<script src="res/jquery.xml2json.js"></script>
|
||||
<script src="res/jquery.json2xml.js"></script>
|
||||
<script src="http://cdn.bootcss.com/json2/20150503/json2.min.js"></script>
|
||||
<script src="http://cdn.bootcss.com/jsonlint/1.6.0/jsonlint.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
var current_json = '';
|
||||
var current_json_str = '';
|
||||
var xml_flag = false;
|
||||
var zip_flag = false;
|
||||
function init(){
|
||||
xml_flag = false;
|
||||
zip_flag = false;
|
||||
$('.xml').attr('style','color:#999;');
|
||||
$('.zip').attr('style','color:#999;');
|
||||
}
|
||||
$('#json-src').keyup(function(){
|
||||
init();
|
||||
var content = $.trim($(this).val());
|
||||
var result = '';
|
||||
if (content!='') {
|
||||
//如果是xml,那么转换为json
|
||||
if (content.substr(0,1) === '<' && content.substr(-1,1) === '>') {
|
||||
try{
|
||||
var json_obj = $.xml2json(content);
|
||||
content = JSON.stringify(json_obj);
|
||||
}catch(e){
|
||||
result = '解析错误:<span style="color: #f1592a;font-weight:bold;">' + e.message + '</span>';
|
||||
current_json_str = result;
|
||||
$('#json-target').html(result);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
try{
|
||||
current_json = jsonlint.parse(content);
|
||||
current_json_str = JSON.stringify(current_json);
|
||||
//current_json = JSON.parse(content);
|
||||
result = new JSONFormat(content,4).toString();
|
||||
}catch(e){
|
||||
result = '<span style="color: #f1592a;font-weight:bold;">' + e + '</span>';
|
||||
current_json_str = result;
|
||||
}
|
||||
|
||||
$('#json-target').html(result);
|
||||
}else{
|
||||
$('#json-target').html('');
|
||||
}
|
||||
|
||||
});
|
||||
$('.xml').click(function(){
|
||||
if (xml_flag) {
|
||||
$('#json-src').keyup();
|
||||
}else{
|
||||
var result = $.json2xml(current_json);
|
||||
$('#json-target').html('<textarea style="width:100%;height:100%;border:0;resize:none;">'+result+'</textarea>');
|
||||
xml_flag = true;
|
||||
$(this).attr('style','color:#15b374;');
|
||||
}
|
||||
|
||||
});
|
||||
$('.zip').click(function(){
|
||||
if (zip_flag) {
|
||||
$('#json-src').keyup();
|
||||
}else{
|
||||
$('#json-target').html(current_json_str);
|
||||
zip_flag = true;
|
||||
$(this).attr('style','color:#15b374;');
|
||||
}
|
||||
|
||||
});
|
||||
$('.clear').click(function(){
|
||||
$('#json-src').val('');
|
||||
$('#json-target').html('');
|
||||
});
|
||||
$('.save').click(function(){
|
||||
var content = JSON.stringify(current_json);
|
||||
$('#txt-content').val(content);
|
||||
$("#form-save").submit();
|
||||
});
|
||||
$('#json-src').keyup();
|
||||
|
||||
function getWinHeight() {
|
||||
var winHeight = 0;
|
||||
if (window.innerHeight)
|
||||
winHeight = window.innerHeight;
|
||||
else if ((document.body) && (document.body.clientHeight))
|
||||
winHeight = document.body.clientHeight;
|
||||
return winHeight;
|
||||
}
|
||||
$(window).resize(function() {
|
||||
$('#json-src').css('height', getWinHeight() - 117);
|
||||
$('#json-target').css('height', getWinHeight() - 160);
|
||||
});
|
||||
$(window).resize();
|
||||
</script>
|
||||
<?php include '../../footer.php';?>
|
|
@ -1,53 +0,0 @@
|
|||
body{
|
||||
font-family:Menlo,Monaco,Consolas,"Helvetica Neue",Helvetica,"Courier New",'微软雅黑', monospace, Arial,sans-serif,'黑体';
|
||||
color: #555;
|
||||
}
|
||||
a{
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
font-family: Menlo,Monaco,Consolas,'微软雅黑';
|
||||
color: #29abe2;
|
||||
}
|
||||
.green{
|
||||
color:#0fd59d;
|
||||
}
|
||||
.red{
|
||||
color:#f98280;
|
||||
}
|
||||
.blue{
|
||||
color:#29abe2;
|
||||
}
|
||||
input:focus, textarea:focus {
|
||||
outline: none;
|
||||
}
|
||||
a:hover{
|
||||
text-decoration: none;
|
||||
color: #15b374;
|
||||
}
|
||||
.label-success{
|
||||
background-color: #0fd59d;
|
||||
}
|
||||
.header{
|
||||
box-shadow: 0px 0px 1px #e5e5e5;
|
||||
border-bottom: solid 1px #d5d5d5;
|
||||
padding: 0px;
|
||||
}
|
||||
.logo{
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
font-size: 24px;
|
||||
color: #0fd59d;
|
||||
padding: 10px;
|
||||
}
|
||||
.navi{
|
||||
padding:5px 20px;
|
||||
font-size:14px;
|
||||
font-weight:bold;font-family:Menlo,Monaco,Consolas,"Courier New",monospace, "Helvetica Neue",Helvetica,Arial,sans-serif,'幼圆'
|
||||
}
|
||||
.navi a{
|
||||
padding: 0px 20px;
|
||||
color: #999;
|
||||
}
|
||||
.navi a:hover{
|
||||
color: #15b374;
|
||||
}
|
|
@ -1,148 +0,0 @@
|
|||
/*!
|
||||
* jQuery Json Plugin (with Transition Definitions)
|
||||
* Examples and documentation at: http://json.cn/
|
||||
* Copyright (c) 2012-2013 China.Ren.
|
||||
* Version: 1.0.2 (19-OCT-2013)
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* http://jquery.malsup.com/license.html
|
||||
* Requires: jQuery v1.3.1 or later
|
||||
*/
|
||||
var JSONFormat = (function(){
|
||||
var _toString = Object.prototype.toString;
|
||||
|
||||
function format(object, indent_count){
|
||||
var html_fragment = '';
|
||||
switch(_typeof(object)){
|
||||
case 'Null' :0
|
||||
html_fragment = _format_null(object);
|
||||
break;
|
||||
case 'Boolean' :
|
||||
html_fragment = _format_boolean(object);
|
||||
break;
|
||||
case 'Number' :
|
||||
html_fragment = _format_number(object);
|
||||
break;
|
||||
case 'String' :
|
||||
html_fragment = _format_string(object);
|
||||
break;
|
||||
case 'Array' :
|
||||
html_fragment = _format_array(object, indent_count);
|
||||
break;
|
||||
case 'Object' :
|
||||
html_fragment = _format_object(object, indent_count);
|
||||
break;
|
||||
}
|
||||
return html_fragment;
|
||||
};
|
||||
|
||||
function _format_null(object){
|
||||
return '<span class="json_null">null</span>';
|
||||
}
|
||||
|
||||
function _format_boolean(object){
|
||||
return '<span class="json_boolean">' + object + '</span>';
|
||||
}
|
||||
|
||||
function _format_number(object){
|
||||
return '<span class="json_number">' + object + '</span>';
|
||||
}
|
||||
|
||||
function _format_string(object){
|
||||
object = object.replace(/\</g,"<");
|
||||
object = object.replace(/\>/g,">");
|
||||
if(0 <= object.search(/^http/)){
|
||||
object = '<a href="' + object + '" target="_blank" class="json_link">' + object + '</a>'
|
||||
}
|
||||
return '<span class="json_string">"' + object + '"</span>';
|
||||
}
|
||||
|
||||
function _format_array(object, indent_count){
|
||||
var tmp_array = [];
|
||||
for(var i = 0, size = object.length; i < size; ++i){
|
||||
tmp_array.push(indent_tab(indent_count) + format(object[i], indent_count + 1));
|
||||
}
|
||||
return '<span data-type="array" data-size="' + tmp_array.length + '"><i style="cursor:pointer;" class="fa fa-minus-square-o" onclick="hide(this)"></i>[<br/>'
|
||||
+ tmp_array.join(',<br/>')
|
||||
+ '<br/>' + indent_tab(indent_count - 1) + ']</span>';
|
||||
}
|
||||
|
||||
function _format_object(object, indent_count){
|
||||
var tmp_array = [];
|
||||
for(var key in object){
|
||||
tmp_array.push( indent_tab(indent_count) + '<span class="json_key">"' + key + '"</span>:' + format(object[key], indent_count + 1));
|
||||
}
|
||||
return '<span data-type="object"><i style="cursor:pointer;" class="fa fa-minus-square-o" onclick="hide(this)"></i>{<br/>'
|
||||
+ tmp_array.join(',<br/>')
|
||||
+ '<br/>' + indent_tab(indent_count - 1) + '}</span>';
|
||||
}
|
||||
|
||||
function indent_tab(indent_count){
|
||||
return (new Array(indent_count + 1)).join(' ');
|
||||
}
|
||||
|
||||
function _typeof(object){
|
||||
var tf = typeof object,
|
||||
ts = _toString.call(object);
|
||||
return null === object ? 'Null' :
|
||||
'undefined' == tf ? 'Undefined' :
|
||||
'boolean' == tf ? 'Boolean' :
|
||||
'number' == tf ? 'Number' :
|
||||
'string' == tf ? 'String' :
|
||||
'[object Function]' == ts ? 'Function' :
|
||||
'[object Array]' == ts ? 'Array' :
|
||||
'[object Date]' == ts ? 'Date' : 'Object';
|
||||
};
|
||||
|
||||
function loadCssString(){
|
||||
var style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
var code = Array.prototype.slice.apply(arguments).join('');
|
||||
try{
|
||||
style.appendChild(document.createTextNode(code));
|
||||
}catch(ex){
|
||||
style.styleSheet.cssText = code;
|
||||
}
|
||||
document.getElementsByTagName('head')[0].appendChild(style);
|
||||
}
|
||||
|
||||
loadCssString(
|
||||
'.json_key{ color: #92278f;font-weight:bold;}',
|
||||
'.json_null{color: #f1592a;font-weight:bold;}',
|
||||
'.json_string{ color: #3ab54a;font-weight:bold;}',
|
||||
'.json_number{ color: #25aae2;font-weight:bold;}',
|
||||
'.json_link{ color: #717171;font-weight:bold;}',
|
||||
'.json_array_brackets{}');
|
||||
|
||||
var _JSONFormat = function(origin_data){
|
||||
//this.data = origin_data ? origin_data :
|
||||
//JSON && JSON.parse ? JSON.parse(origin_data) : eval('(' + origin_data + ')');
|
||||
this.data = JSON.parse(origin_data);
|
||||
};
|
||||
|
||||
_JSONFormat.prototype = {
|
||||
constructor : JSONFormat,
|
||||
toString : function(){
|
||||
return format(this.data, 1);
|
||||
}
|
||||
}
|
||||
|
||||
return _JSONFormat;
|
||||
|
||||
})();
|
||||
var last_html = '';
|
||||
function hide(obj){
|
||||
var data_type = obj.parentNode.getAttribute('data-type');
|
||||
var data_size = obj.parentNode.getAttribute('data-size');
|
||||
obj.parentNode.setAttribute('data-inner',obj.parentNode.innerHTML);
|
||||
if (data_type === 'array') {
|
||||
obj.parentNode.innerHTML = '<i style="cursor:pointer;" class="fa fa-plus-square-o" onclick="show(this)"></i>Array[<span class="json_number">' + data_size + '</span>]';
|
||||
}else{
|
||||
obj.parentNode.innerHTML = '<i style="cursor:pointer;" class="fa fa-plus-square-o" onclick="show(this)"></i>Object{...}';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function show(obj){
|
||||
var innerHtml = obj.parentNode.getAttribute('data-inner');
|
||||
obj.parentNode.innerHTML = innerHtml;
|
||||
}
|
|
@ -1,206 +0,0 @@
|
|||
/**
|
||||
* JSON to XML jQuery plugin. Provides quick way to convert JSON object to XML
|
||||
* string. To some extent, allows control over XML output.
|
||||
* Just as jQuery itself, this plugin is released under both MIT & GPL licences.
|
||||
*
|
||||
* @version 1.02
|
||||
* @author Micha Korecki, www.michalkorecki.com
|
||||
*/
|
||||
(function($) {
|
||||
/**
|
||||
* Converts JSON object to XML string.
|
||||
*
|
||||
* @param json object to convert
|
||||
* @param options additional parameters
|
||||
* @return XML string
|
||||
*/
|
||||
$.json2xml = function(json, options) {
|
||||
settings = {};
|
||||
settings = $.extend(true, settings, defaultSettings, options || { });
|
||||
return '<?xml version="1.0" encoding="UTF-8"?>'+convertToXml(json, settings.rootTagName, '', 0);
|
||||
};
|
||||
|
||||
var defaultSettings = {
|
||||
formatOutput: true,
|
||||
formatTextNodes: false,
|
||||
indentString: ' ',
|
||||
rootTagName: 'root',
|
||||
ignore: [],
|
||||
replace: [],
|
||||
nodes: [],
|
||||
///TODO: exceptions system
|
||||
exceptions: []
|
||||
};
|
||||
|
||||
/**
|
||||
* This is actual settings object used throught plugin, default settings
|
||||
* are stored separately to prevent overriding when using multiple times.
|
||||
*/
|
||||
var settings = {};
|
||||
|
||||
/**
|
||||
* Core function parsing JSON to XML. It iterates over object properties and
|
||||
* creates XML attributes appended to main tag, if property is primitive
|
||||
* value (eg. string, number).
|
||||
* Otherwise, if it's array or object, new node is created and appened to
|
||||
* parent tag.
|
||||
* You can alter this behaviour by providing values in settings.ignore,
|
||||
* settings.replace and settings.nodes arrays.
|
||||
*
|
||||
* @param json object to parse
|
||||
* @param tagName name of tag created for parsed object
|
||||
* @param parentPath path to properly identify elements in ignore, replace
|
||||
* and nodes arrays
|
||||
* @param depth current element's depth
|
||||
* @return XML string
|
||||
*/
|
||||
var convertToXml = function(json, tagName, parentPath, depth) {
|
||||
var suffix = (settings.formatOutput) ? '\r\n' : '';
|
||||
var indent = (settings.formatOutput) ? getIndent(depth) : '';
|
||||
var xmlTag = indent + '<' + tagName;
|
||||
var children = '';
|
||||
|
||||
for (var key in json) {
|
||||
if (json.hasOwnProperty(key)) {
|
||||
var propertyPath = parentPath + key;
|
||||
var propertyName = getPropertyName(parentPath, key);
|
||||
// element not in ignore array, process
|
||||
if ($.inArray(propertyPath, settings.ignore) == -1) {
|
||||
// array, create new child element
|
||||
if ($.isArray(json[key])) {
|
||||
children += createNodeFromArray(json[key], propertyName,
|
||||
propertyPath + '.', depth + 1, suffix);
|
||||
}
|
||||
// object, new child element aswell
|
||||
else if (typeof(json[key]) === 'object') {
|
||||
children += convertToXml(json[key], propertyName,
|
||||
propertyPath + '.', depth + 1);
|
||||
}
|
||||
// primitive value property as attribute
|
||||
else {
|
||||
// unless it's explicitly defined it should be node
|
||||
if ( propertyName.indexOf('@')==-1) {
|
||||
children += createTextNode(propertyName, json[key],
|
||||
depth, suffix);
|
||||
}
|
||||
else {
|
||||
propertyName = propertyName.replace('@','');
|
||||
xmlTag += ' ' + propertyName + '="' + json[key] + '"';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// close tag properly
|
||||
if (children !== '') {
|
||||
xmlTag += '>' + suffix + children + indent + '</' + tagName + '>' + suffix;
|
||||
}
|
||||
else {
|
||||
xmlTag += '/>' + suffix;
|
||||
}
|
||||
return xmlTag;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Creates indent string for provided depth value. See settings for details.
|
||||
*
|
||||
* @param depth
|
||||
* @return indent string
|
||||
*/
|
||||
var getIndent = function(depth) {
|
||||
var output = '';
|
||||
for (var i = 0; i < depth; i++) {
|
||||
output += settings.indentString;
|
||||
}
|
||||
return output;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Checks settings.replace array for provided name, if it exists returns
|
||||
* replacement name. Else, original name is returned.
|
||||
*
|
||||
* @param parentPath path to this element's parent
|
||||
* @param name name of element to look up
|
||||
* @return element's final name
|
||||
*/
|
||||
var getPropertyName = function(parentPath, name) {
|
||||
var index = settings.replace.length;
|
||||
var searchName = parentPath + name;
|
||||
while (index--) {
|
||||
// settings.replace array consists of {original : replacement}
|
||||
// objects
|
||||
if (settings.replace[index].hasOwnProperty(searchName)) {
|
||||
return settings.replace[index][searchName];
|
||||
}
|
||||
}
|
||||
return name;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates XML node from javascript array object.
|
||||
*
|
||||
* @param source
|
||||
* @param name XML element name
|
||||
* @param path parent element path string
|
||||
* @param depth
|
||||
* @param suffix node suffix (whether to format output or not)
|
||||
* @return XML tag string for provided array
|
||||
*/
|
||||
var createNodeFromArray = function(source, name, path, depth, suffix) {
|
||||
var xmlNode = '';
|
||||
if (source.length > 0) {
|
||||
for (var index in source) {
|
||||
// array's element isn't object - it's primitive value, which
|
||||
// means array might need to be converted to text nodes
|
||||
if (typeof(source[index]) !== 'object') {
|
||||
// empty strings will be converted to empty nodes
|
||||
if (source[index] === "") {
|
||||
xmlNode += getIndent(depth) + '<' + name + '/>' + suffix;
|
||||
}
|
||||
else {
|
||||
var textPrefix = (settings.formatTextNodes)
|
||||
? suffix + getIndent(depth + 1) : '';
|
||||
var textSuffix = (settings.formatTextNodes)
|
||||
? suffix + getIndent(depth) : '';
|
||||
xmlNode += getIndent(depth) + '<' + name + '>'
|
||||
+ textPrefix + source[index] + textSuffix
|
||||
+ '</' + name + '>' + suffix;
|
||||
}
|
||||
}
|
||||
// else regular conversion applies
|
||||
else {
|
||||
xmlNode += convertToXml(source[index], name, path, depth);
|
||||
}
|
||||
}
|
||||
}
|
||||
// array is empty, also creating empty XML node
|
||||
else {
|
||||
xmlNode += getIndent(depth) + '<' + name + '/>' + suffix;
|
||||
}
|
||||
return xmlNode;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates node containing text only.
|
||||
*
|
||||
* @param name node's name
|
||||
* @param text node text string
|
||||
* @param parentDepth this node's parent element depth
|
||||
* @param suffix node suffix (whether to format output or not)
|
||||
* @return XML tag string
|
||||
*/
|
||||
var createTextNode = function(name, text, parentDepth, suffix) {
|
||||
// unformatted text node: <node>value</node>
|
||||
// formatting includes value indentation and new lines
|
||||
var textPrefix = (settings.formatTextNodes)
|
||||
? suffix + getIndent(parentDepth + 2) : '';
|
||||
var textSuffix = (settings.formatTextNodes)
|
||||
? suffix + getIndent(parentDepth + 1) : '';
|
||||
var xmlNode = getIndent(parentDepth + 1) + '<' + name + '>'
|
||||
+ textPrefix + text + textSuffix
|
||||
+ '</' + name + '>' + suffix;
|
||||
return xmlNode;
|
||||
};
|
||||
})(jQuery);
|
|
@ -1,61 +0,0 @@
|
|||
/*!
|
||||
* jQuery Message Plugin (with Transition Definitions)
|
||||
* Examples and documentation at: http://eadmarket.com/
|
||||
* Copyright (c) 2012-2013 China.Ren.
|
||||
* Version: 1.0.2 (19-OCT-2013)
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* http://jquery.malsup.com/license.html
|
||||
* Requires: jQuery v1.3.1 or later
|
||||
*/
|
||||
var container=$('#jquery-beauty-msg');
|
||||
if(container.length<=0){
|
||||
$("body").append('<div style="clear:both;"></div><div id="jquery-beauty-msg"></div>');
|
||||
container=$('#jquery-beauty-msg');
|
||||
}
|
||||
var containerStyle='color:#e1282b;font-family:"微软雅黑";font-weight:bold;font-size:20px;text-shadow:5px 5px 10px #bbb;'
|
||||
+'text-align:center;margin:0;padding-top:20%;width:100%;word-break:break-all;z-index:100000;';
|
||||
var closeFlag=false;
|
||||
var timer=0;
|
||||
var msgContent='';
|
||||
$.msg=function(txt,style,obj,delay){
|
||||
msgContent=txt;
|
||||
|
||||
if(obj!="undefined"&&obj!=null){
|
||||
containerStyle+='position:relative;top:'+$(obj).attr('top')+';left:'+$(obj).attr('left')+';';
|
||||
}
|
||||
else{
|
||||
containerStyle+='position:fixed;top:0;left:0;';
|
||||
$(container).attr('style',containerStyle+style);
|
||||
$(container).html(msgContent);
|
||||
$(container).fadeIn(300,function(){
|
||||
$(container).animate({fontSize:'40px'},'300');
|
||||
$(container).delay(1000).fadeOut();
|
||||
});
|
||||
}
|
||||
}
|
||||
function addDot(){
|
||||
msgContent=msgContent+".";
|
||||
$(container).html(msgContent);
|
||||
timer=timer+1;
|
||||
if(!closeFlag&&timer>=5){
|
||||
$(container).html("操作超时!");
|
||||
window.clearInterval();
|
||||
}
|
||||
}
|
||||
$.loading=function(txt,action){
|
||||
msgContent=txt;
|
||||
containerStyle+='position:fixed;top:0;left:0;';
|
||||
$(container).attr('style',containerStyle+"color:blue;");
|
||||
$(container).html(msgContent);
|
||||
if(action!="close"){
|
||||
$(container).fadeIn(300,function(){
|
||||
$(container).animate({fontSize:'40px'},'300');
|
||||
});
|
||||
window.setInterval("addDot",1000);
|
||||
|
||||
}else{
|
||||
window.clearInterval();
|
||||
closeFlag=true;
|
||||
$(container).fadeOut();
|
||||
}
|
||||
}
|
|
@ -1,193 +0,0 @@
|
|||
/*
|
||||
### jQuery XML to JSON Plugin v1.3 - 2013-02-18 ###
|
||||
* http://www.fyneworks.com/ - diego@fyneworks.com
|
||||
* Licensed under http://en.wikipedia.org/wiki/MIT_License
|
||||
###
|
||||
Website: http://www.fyneworks.com/jquery/xml-to-json/
|
||||
*//*
|
||||
# INSPIRED BY: http://www.terracoder.com/
|
||||
AND: http://www.thomasfrank.se/xml_to_json.html
|
||||
AND: http://www.kawa.net/works/js/xml/objtree-e.html
|
||||
*//*
|
||||
This simple script converts XML (document of code) into a JSON object. It is the combination of 2
|
||||
'xml to json' great parsers (see below) which allows for both 'simple' and 'extended' parsing modes.
|
||||
*/
|
||||
// Avoid collisions
|
||||
;if(window.jQuery) (function($){
|
||||
|
||||
// Add function to jQuery namespace
|
||||
$.extend({
|
||||
|
||||
// converts xml documents and xml text to json object
|
||||
xml2json: function(xml, extended) {
|
||||
if(!xml) return {}; // quick fail
|
||||
|
||||
//### PARSER LIBRARY
|
||||
// Core function
|
||||
function parseXML(node, simple){
|
||||
if(!node) return null;
|
||||
var txt = '', obj = null, att = null;
|
||||
var nt = node.nodeType, nn = jsVar(node.localName || node.nodeName);
|
||||
var nv = node.text || node.nodeValue || '';
|
||||
/*DBG*/ //if(window.console) console.log(['x2j',nn,nt,nv.length+' bytes']);
|
||||
if(node.childNodes){
|
||||
if(node.childNodes.length>0){
|
||||
/*DBG*/ //if(window.console) console.log(['x2j',nn,'CHILDREN',node.childNodes]);
|
||||
$.each(node.childNodes, function(n,cn){
|
||||
var cnt = cn.nodeType, cnn = jsVar(cn.localName || cn.nodeName);
|
||||
var cnv = cn.text || cn.nodeValue || '';
|
||||
/*DBG*/ //if(window.console) console.log(['x2j',nn,'node>a',cnn,cnt,cnv]);
|
||||
if(cnt == 8){
|
||||
/*DBG*/ //if(window.console) console.log(['x2j',nn,'node>b',cnn,'COMMENT (ignore)']);
|
||||
return; // ignore comment node
|
||||
}
|
||||
else if(cnt == 3 || cnt == 4 || !cnn){
|
||||
// ignore white-space in between tags
|
||||
if(cnv.match(/^\s+$/)){
|
||||
/*DBG*/ //if(window.console) console.log(['x2j',nn,'node>c',cnn,'WHITE-SPACE (ignore)']);
|
||||
return;
|
||||
};
|
||||
/*DBG*/ //if(window.console) console.log(['x2j',nn,'node>d',cnn,'TEXT']);
|
||||
txt += cnv.replace(/^\s+/,'').replace(/\s+$/,'');
|
||||
// make sure we ditch trailing spaces from markup
|
||||
}
|
||||
else{
|
||||
/*DBG*/ //if(window.console) console.log(['x2j',nn,'node>e',cnn,'OBJECT']);
|
||||
obj = obj || {};
|
||||
if(obj[cnn]){
|
||||
/*DBG*/ //if(window.console) console.log(['x2j',nn,'node>f',cnn,'ARRAY']);
|
||||
|
||||
// http://forum.jquery.com/topic/jquery-jquery-xml2json-problems-when-siblings-of-the-same-tagname-only-have-a-textnode-as-a-child
|
||||
if(!obj[cnn].length) obj[cnn] = myArr(obj[cnn]);
|
||||
obj[cnn] = myArr(obj[cnn]);
|
||||
|
||||
obj[cnn][ obj[cnn].length ] = parseXML(cn, true/* simple */);
|
||||
obj[cnn].length = obj[cnn].length;
|
||||
}
|
||||
else{
|
||||
/*DBG*/ //if(window.console) console.log(['x2j',nn,'node>g',cnn,'dig deeper...']);
|
||||
obj[cnn] = parseXML(cn);
|
||||
};
|
||||
};
|
||||
});
|
||||
};//node.childNodes.length>0
|
||||
};//node.childNodes
|
||||
if(node.attributes){
|
||||
if(node.attributes.length>0){
|
||||
/*DBG*/ //if(window.console) console.log(['x2j',nn,'ATTRIBUTES',node.attributes])
|
||||
att = {}; obj = obj || {};
|
||||
$.each(node.attributes, function(a,at){
|
||||
var atn = jsVar('@'+at.name), atv = at.value;
|
||||
att[atn] = atv;
|
||||
if(obj[atn]){
|
||||
/*DBG*/ //if(window.console) console.log(['x2j',nn,'attr>',atn,'ARRAY']);
|
||||
|
||||
// http://forum.jquery.com/topic/jquery-jquery-xml2json-problems-when-siblings-of-the-same-tagname-only-have-a-textnode-as-a-child
|
||||
//if(!obj[atn].length) obj[atn] = myArr(obj[atn]);//[ obj[ atn ] ];
|
||||
obj[cnn] = myArr(obj[cnn]);
|
||||
|
||||
obj[atn][ obj[atn].length ] = atv;
|
||||
obj[atn].length = obj[atn].length;
|
||||
}
|
||||
else{
|
||||
/*DBG*/ //if(window.console) console.log(['x2j',nn,'attr>',atn,'TEXT']);
|
||||
obj[atn] = atv;
|
||||
};
|
||||
});
|
||||
//obj['attributes'] = att;
|
||||
};//node.attributes.length>0
|
||||
};//node.attributes
|
||||
if(obj){
|
||||
obj = $.extend( (txt!='' ? new String(txt) : {}),/* {text:txt},*/ obj || {}/*, att || {}*/);
|
||||
//txt = (obj.text) ? (typeof(obj.text)=='object' ? obj.text : [obj.text || '']).concat([txt]) : txt;
|
||||
txt = (obj.text) ? ([obj.text || '']).concat([txt]) : txt;
|
||||
if(txt) obj.text = txt;
|
||||
txt = '';
|
||||
};
|
||||
var out = obj || txt;
|
||||
//console.log([extended, simple, out]);
|
||||
if(extended){
|
||||
if(txt) out = {};//new String(out);
|
||||
txt = out.text || txt || '';
|
||||
if(txt) out.text = txt;
|
||||
if(!simple) out = myArr(out);
|
||||
};
|
||||
return out;
|
||||
};// parseXML
|
||||
// Core Function End
|
||||
// Utility functions
|
||||
var jsVar = function(s){ return String(s || '').replace(/-/g,"_"); };
|
||||
|
||||
// NEW isNum function: 01/09/2010
|
||||
// Thanks to Emile Grau, GigaTecnologies S.L., www.gigatransfer.com, www.mygigamail.com
|
||||
function isNum(s){
|
||||
// based on utility function isNum from xml2json plugin (http://www.fyneworks.com/ - diego@fyneworks.com)
|
||||
// few bugs corrected from original function :
|
||||
// - syntax error : regexp.test(string) instead of string.test(reg)
|
||||
// - regexp modified to accept comma as decimal mark (latin syntax : 25,24 )
|
||||
// - regexp modified to reject if no number before decimal mark : ".7" is not accepted
|
||||
// - string is "trimmed", allowing to accept space at the beginning and end of string
|
||||
var regexp=/^((-)?([0-9]+)(([\.\,]{0,1})([0-9]+))?$)/
|
||||
return (typeof s == "number") || regexp.test(String((s && typeof s == "string") ? jQuery.trim(s) : ''));
|
||||
};
|
||||
// OLD isNum function: (for reference only)
|
||||
//var isNum = function(s){ return (typeof s == "number") || String((s && typeof s == "string") ? s : '').test(/^((-)?([0-9]*)((\.{0,1})([0-9]+))?$)/); };
|
||||
|
||||
var myArr = function(o){
|
||||
|
||||
// http://forum.jquery.com/topic/jquery-jquery-xml2json-problems-when-siblings-of-the-same-tagname-only-have-a-textnode-as-a-child
|
||||
//if(!o.length) o = [ o ]; o.length=o.length;
|
||||
if(!$.isArray(o)) o = [ o ]; o.length=o.length;
|
||||
|
||||
// here is where you can attach additional functionality, such as searching and sorting...
|
||||
return o;
|
||||
};
|
||||
// Utility functions End
|
||||
//### PARSER LIBRARY END
|
||||
|
||||
// Convert plain text to xml
|
||||
if(typeof xml=='string') xml = $.text2xml(xml);
|
||||
|
||||
// Quick fail if not xml (or if this is a node)
|
||||
if(!xml.nodeType) return;
|
||||
if(xml.nodeType == 3 || xml.nodeType == 4) return xml.nodeValue;
|
||||
|
||||
// Find xml root node
|
||||
var root = (xml.nodeType == 9) ? xml.documentElement : xml;
|
||||
|
||||
// Convert xml to json
|
||||
var out = parseXML(root, true /* simple */);
|
||||
|
||||
// Clean-up memory
|
||||
xml = null; root = null;
|
||||
|
||||
// Send output
|
||||
return out;
|
||||
},
|
||||
|
||||
// Convert text to XML DOM
|
||||
text2xml: function(str) {
|
||||
// NOTE: I'd like to use jQuery for this, but jQuery makes all tags uppercase
|
||||
//return $(xml)[0];
|
||||
|
||||
/* prior to jquery 1.9 */
|
||||
/*
|
||||
var out;
|
||||
try{
|
||||
var xml = ((!$.support.opacity && !$.support.style))?new ActiveXObject("Microsoft.XMLDOM"):new DOMParser();
|
||||
xml.async = false;
|
||||
}catch(e){ throw new Error("XML Parser could not be instantiated") };
|
||||
try{
|
||||
if((!$.support.opacity && !$.support.style)) out = (xml.loadXML(str))?xml:false;
|
||||
else out = xml.parseFromString(str, "text/xml");
|
||||
}catch(e){ throw new Error("Error parsing XML string") };
|
||||
return out;
|
||||
*/
|
||||
|
||||
/* jquery 1.9+ */
|
||||
return $.parseXML(str);
|
||||
}
|
||||
|
||||
}); // extend $
|
||||
|
||||
})(jQuery);
|
|
@ -1,28 +0,0 @@
|
|||
<?php
|
||||
$id="6";
|
||||
include '../../header.php';?>
|
||||
<div class="container clearfix">
|
||||
<div class="row row-xs">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-10 col-xs-offset-1 col-sm-offset-3 col-md-offset-3 col-lg-offset-3">
|
||||
<div class="page-header">
|
||||
<h3 class="text-center h3-xs"><?php echo $title;?><small class="text-capitalize"><?php echo $subtitle;?></small></h3>
|
||||
</div>
|
||||
<h5 class="text-right"><small><?php echo $explains;?></small></h5>
|
||||
<div class="form-group" id="input-wrap">
|
||||
<label class="control-label control-msg" for="inputContent" copy="Youngxj|杨小杰,admin@youngxj.com"></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" aria-label="...">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" type="button" id="btn_state">启动</button>
|
||||
</div><!-- /btn-group -->
|
||||
</div><!-- /input-group -->
|
||||
</div><!-- /.col-lg-6 -->
|
||||
<div class="form-controlss text-center">
|
||||
<div id="content"></div>
|
||||
<div id="msg"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="kg.php"></script>
|
||||
<?php include '../../footer.php';?>
|
|
@ -1,25 +0,0 @@
|
|||
/**
|
||||
* @act 全民k歌
|
||||
* @version 1.0
|
||||
* @author youngxj
|
||||
* @date 2018-03-24
|
||||
* @url http://www.youngxj.cn
|
||||
*/
|
||||
|
||||
control('请输入全民K歌地址:');
|
||||
$("#btn_state").click(function(){
|
||||
if ($('.form-control').val() == "") {layer.alert('你是不是忘记填内容了?');return false;}
|
||||
$.getJSON("https://api.yum6.cn/kg/kg.php?url="+$('.form-control').val(),function(result){
|
||||
if (result.code=="1") {
|
||||
$('#content').html('<p><audio autoplay="autoplay" controls="controls"loop="loop" preload="auto"src="'+result.url+'"> 你的浏览器不支持audio标签</audio></p>');
|
||||
$('#msg').html('<div class="well">下载地址(右键另存为):<a class="btn btn-success" role="button" href="'+result.url+'" target="_blank">下载音乐</a></div>');
|
||||
}else if(result.code=="2"){
|
||||
$('#content').html('<p><video autoplay="autoplay" controls="controls" loop="loop" preload="video"src="'+result.url+'"> 你的浏览器不支持video标签</video></p>');
|
||||
$('#msg').html('<div class="well">下载地址(右键另存为):<a class="btn btn-success" role="button" href="'+result.url+'" target="_blank">下载视频</a></div>');
|
||||
}else if(result.status=="-1"){
|
||||
layer.msg(result.msg);
|
||||
}else{
|
||||
layer.msg('解析失败!');
|
||||
}
|
||||
});
|
||||
});
|
|
@ -1,337 +0,0 @@
|
|||
<?php
|
||||
$id = '41';
|
||||
include '../../header.php';
|
||||
?>
|
||||
<script language="javascript" type="text/javascript">
|
||||
function LENGTH_MEASURES() {
|
||||
this.mKilometer = 1000;
|
||||
this.mMeter = 1;
|
||||
this.mDecimeter = 0.1;
|
||||
this.mCentimeter = 0.01;
|
||||
this.mMillimeter = 0.001;
|
||||
this.mDecimillimetre = 0.00001;
|
||||
this.mMicronmeter = 0.000001;
|
||||
this.nMicronmeter = 0.000000001;
|
||||
this.mLimeter = 500;
|
||||
this.mZhangmeter = 10 / 3;
|
||||
this.mChimeter = 1 / 3;
|
||||
this.mCunmeter = 1 / 30;
|
||||
this.mFenmeter = 1 / 300;
|
||||
this.mmLimeter = 1 / 3000;
|
||||
this.engFoot = 0.3048;
|
||||
this.engMile = 5280 * this.engFoot;
|
||||
this.engFurlong = 660 * this.engFoot;
|
||||
this.engYard = 3 * this.engFoot;
|
||||
this.engInch = this.engFoot / 12;
|
||||
this.nautMile = 1852;
|
||||
this.nautFathom = 6 * this.engFoot;
|
||||
}
|
||||
var length_data = new LENGTH_MEASURES();
|
||||
function checkNum(str) {
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
var ch = str.substring(i, i + 1);
|
||||
if (ch != "." && ch != "+" && ch != "-" && ch != "e" && ch != "E" && (ch < "0" || ch > "9")) {
|
||||
alert("请输入有效的数字");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function normalize(what, digits) {
|
||||
var str = "" + what;
|
||||
var pp = Math.max(str.lastIndexOf("+"), str.lastIndexOf("-"));
|
||||
var idot = str.indexOf(".");
|
||||
if (idot >= 1) {
|
||||
var ee = (pp > 0) ? str.substring(pp - 1, str.length) : "";
|
||||
digits += idot;
|
||||
if (digits >= str.length) {
|
||||
return str;
|
||||
}
|
||||
if (pp > 0 && digits >= pp) {
|
||||
digits -= pp;
|
||||
}
|
||||
var c = eval(str.charAt(digits));
|
||||
var ipos = digits - 1;
|
||||
if (c >= 5) {
|
||||
while (str.charAt(ipos) == "9") {
|
||||
ipos--;
|
||||
}
|
||||
if (str.charAt(ipos) == ".") {
|
||||
var nc = eval(str.substring(0, idot)) + 1;
|
||||
if (nc == 10 && ee.length > 0) {
|
||||
nc = 1;
|
||||
ee = "e" + (eval(ee.substring(1, ee.length)) + 1);
|
||||
}
|
||||
return "" + nc + ee;
|
||||
}
|
||||
return str.substring(0, ipos) + (eval(str.charAt(ipos)) + 1) + ee;
|
||||
} else {
|
||||
var ret = str.substring(0, digits) + ee;
|
||||
}
|
||||
for (var i = 0; i < ret.length; i++) {
|
||||
if (ret.charAt(i) > "0" && ret.charAt(i) <= "9") {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
function compute(obj, val, data) {
|
||||
if (obj[val].value) {
|
||||
var uval = 0;
|
||||
uval = obj[val].value * data[val];
|
||||
if ((uval >= 0) && (obj[val].value.indexOf("-") != -1)) {
|
||||
uval = -uval;
|
||||
}
|
||||
for (var i in data) {
|
||||
obj[i].value = normalize(uval / data[i], 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
function resetValues(form, data) {
|
||||
for (var i in data) {
|
||||
form[i].value = "";
|
||||
}
|
||||
}
|
||||
function resetAll(form) {
|
||||
resetValues(form, length_data);
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
tr td{padding: 0px 5px 0px 5px;}
|
||||
</style>
|
||||
<div class="container">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">在线长度换算器</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<form action="">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">公里(km)</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=mKilometer size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(mKilometer.value)) compute(this.form,mKilometer.name,length_data)" type=button value="换算" class="btn btn-default" name=mKilometer_bt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">米(m)</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=mMeter size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(mMeter.value)) compute(this.form,mMeter.name,length_data)" type=button value="换算" class="btn btn-default" name=mMeter_bt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">分米(dm)</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=mDecimeter size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(mDecimeter.value)) compute(this.form,mDecimeter.name,length_data)" type=button value="换算" class="btn btn-default" name=mDecimeter_bt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">厘米(cm)</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=mCentimeter size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(mCentimeter.value)) compute(this.form,mCentimeter.name,length_data)" type=button value="换算" class="btn btn-default" name=mCentimeter_bt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">毫米(mm)</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=mMillimeter size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(mMillimeter.value)) compute(this.form,mMillimeter.name,length_data)" type=button value="换算" class="btn btn-default" name=mMillimeter_bt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">丝(dmm)</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=mDecimillimetre size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(mDecimillimetre.value)) compute(this.form,mDecimillimetre.name,length_data)" type=button value="换算" class="btn btn-default" name=mDecimillimetre_bt>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">微米(um)</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=mMicronmeter size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(mMicronmeter.value)) compute(this.form,mMicronmeter.name,length_data)" type=button value="换算" class="btn btn-default" name=mMicronmeter_bt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">里</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=mLimeter size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(mLimeter.value)) compute(this.form,mLimeter.name,length_data)" type=button value="换算" class="btn btn-default" name=mLimeter_bt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">丈</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=mZhangmeter size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(mZhangmeter.value)) compute(this.form,mZhangmeter.name,length_data)" type=button value="换算" class="btn btn-default" name=mZhangmeter_bt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">尺</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=mChimeter size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(mChimeter.value)) compute(this.form,mChimeter.name,length_data)" type=button value="换算" class="btn btn-default" name=mChimeter_bt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">寸</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=mCunmeter size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(mCunmeter.value)) compute(this.form,mCunmeter.name,length_data)" type=button value="换算" class="btn btn-default" name=mCunmeter_bt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">分</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=mFenmeter size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(mFenmeter.value)) compute(this.form,mFenmeter.name,length_data)" type=button value="换算" class="btn btn-default" name=mFenmeter_bt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">厘</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=mmLimeter size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(mmLimeter.value)) compute(this.form,mmLimeter.name,length_data)" type=button value="换算" class="btn btn-default" name=mmLimeter_bt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">海里(nmi)</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=nautMile size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(nautMile.value)) compute(this.form,nautMile.name,length_data)" type=button value="换算" class="btn btn-default" name=nautMile_bt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">英寻</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=nautFathom size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(nautFathom.value)) compute(this.form,nautFathom.name,length_data)" type=button value="换算" class="btn btn-default" name=nautFathom_bt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">英里(mi)</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=engMile size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(engMile.value)) compute(this.form,engMile.name,length_data)" type=button value="换算" class="btn btn-default" name=engMile_bt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">弗隆(fur)</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=engFurlong size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(engFurlong.value)) compute(this.form,engFurlong.name,length_data)" type=button value="换算" class="btn btn-default" name=engFurlong_bt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">码(yd)</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=engYard size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(engYard.value)) compute(this.form,engYard.name,length_data)" type=button value="换算" class="btn btn-default" name=engYard_bt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">英尺(ft)</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=engFoot size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(engFoot.value)) compute(this.form,engFoot.name,length_data)" type=button value="换算" class="btn btn-default" name=engFoot_bt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">英寸(in)</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=engInch size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(engInch.value)) compute(this.form,engInch.name,length_data)" type=button value="换算" class="btn btn-default" name=engInch_bt>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">纳米(nm)</label>
|
||||
<div class="col-sm-5">
|
||||
<input name=nMicronmeter size="15" class="form-control">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input onClick="if (checkNum(nMicronmeter.value)) compute(this.form,nMicronmeter.name,length_data)" type=button value="换算" class="btn btn-default" name=nMicronmeter_bt>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div align="right"><input onClick=resetAll(this.form) type=button value="数据重置" name=res7 class="btn btn-success"></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">工具简介</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p>长度换算器:可实现在线公里(km)、米(m)、分米(dm)、厘米(cm)、里、丈、尺、寸、分、厘、海里(nmi)、英寻、英里、弗隆(fur)、码(yd)、英尺(ft)、英寸(in)、毫米(mm)、微米(um)间的互转互换。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include '../../footer.php';?>
|
|
@ -1,43 +0,0 @@
|
|||
<?php
|
||||
$id="40";
|
||||
include '../../header.php';?>
|
||||
<script src="js.js"></script>
|
||||
<div class="container clearfix">
|
||||
<div class="row row-xs">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-10 col-xs-offset-1 col-sm-offset-3 col-md-offset-3 col-lg-offset-3">
|
||||
<div class="page-header">
|
||||
<h3 class="text-center h3-xs"><?php echo $title;?><small class="text-capitalize"><?php echo $subtitle;?></small></h3>
|
||||
</div>
|
||||
<h5 class="text-right"><small><?php echo $explains;?></small></h5>
|
||||
<form name="ascii">
|
||||
<div class="form-group">
|
||||
<label class="sr-only" for="exampleInputAmount">英文字母</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">文本</div>
|
||||
<input type="text" class="form-control" id="exampleInputAmount" placeholder="Young xj" value="Young xj" name="inputField">
|
||||
</div>
|
||||
<div>字体风格:
|
||||
<select name="textStyle" class="form-control">
|
||||
<option>Futuristik</option>
|
||||
<option selected="">Block</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input onclick="beginGenerator()" type="button" value="生成线条字" name="button" class="btn btn-success">
|
||||
<input onclick="outputField.select();document.execCommand("Copy")" type="button" value="复制" class="btn btn-info">
|
||||
|
||||
</div>
|
||||
<span id="windowMarker">
|
||||
<textarea name="outputField" wrap="off" style="height:200px; font-family:'宋体';" class="form-control">
|
||||
线条字生成器,是一个生成由字符组成的“线条字”的在线转换工具。因其笔划形如缝纫线痕,故名。
|
||||
本转换器只支持字母和数字的转换,另外,可以使用换行符“\n”对输入的内容进行一次换行操作。
|
||||
</textarea>
|
||||
</span>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php include '../../footer.php';?>
|
|
@ -1,200 +0,0 @@
|
|||
|
||||
function previewStyle() {
|
||||
if (!document.all){
|
||||
alert("You need IE 4+ to preview style!")
|
||||
return
|
||||
}
|
||||
if(document.ascii.textStyle[0].selected&&document.all) {style1.style.display = ""; style1.style.top = (windowMarker.offsetTop+20); style1.style.left = (screen.width / 3)}
|
||||
if(document.ascii.textStyle[1].selected&&document.all) {style2.style.display = ""; style2.style.top = (windowMarker.offsetTop+20); style2.style.left = (screen.width / 4)}
|
||||
if(document.ascii.textStyle[2].selected&&document.all) {style3.style.display = ""; style3.style.top = (windowMarker.offsetTop+20); style3.style.left = (screen.width / 4)}
|
||||
}
|
||||
function beginGenerator() {
|
||||
var validChars = true;
|
||||
var inputText = document.ascii.inputField.value;
|
||||
inputText = inputText.toLowerCase();
|
||||
for(i = 0; i < inputText.length; i++) {
|
||||
if(inputText.charAt(i) != "a" && inputText.charAt(i) != "b" && inputText.charAt(i) != "c" && inputText.charAt(i) != "d" && inputText.charAt(i) != "e" && inputText.charAt(i) != "f" && inputText.charAt(i) != "g" && inputText.charAt(i) != "h" && inputText.charAt(i) != "i" && inputText.charAt(i) != "j" && inputText.charAt(i) != "k" && inputText.charAt(i) != "l" && inputText.charAt(i) != "m" && inputText.charAt(i) != "n" && inputText.charAt(i) != "o" && inputText.charAt(i) != "p" && inputText.charAt(i) != "q" && inputText.charAt(i) != "r" && inputText.charAt(i) != "s" && inputText.charAt(i) != "t" && inputText.charAt(i) != "u" && inputText.charAt(i) != "v" && inputText.charAt(i) != "w" && inputText.charAt(i) != "x" && inputText.charAt(i) != "y" && inputText.charAt(i) != "z" && inputText.charAt(i) != " " && inputText.charAt(i) != "0" && inputText.charAt(i) != "1" && inputText.charAt(i) != "2" && inputText.charAt(i) != "3" && inputText.charAt(i) != "4" && inputText.charAt(i) != "5" && inputText.charAt(i) != "6" && inputText.charAt(i) != "7" && inputText.charAt(i) != "8" && inputText.charAt(i) != "9" && inputText.substring(i,(i+2)) != "\\n") {validChars = false; invalChar = inputText.charAt(i)};
|
||||
}
|
||||
if(validChars == false) {alert('错误:字符 "'+invalChar+'" 无效。 只有字母 a-z 数字 0-9 被接受。')}
|
||||
if(validChars == true) {
|
||||
if(document.ascii.textStyle[0].selected) {buildStyle1(inputText)}
|
||||
if(document.ascii.textStyle[1].selected) {buildStyle2(inputText)}
|
||||
}
|
||||
}
|
||||
function buildStyle1(inputText,booleanRepeat) {
|
||||
var newline = false; var line0 = ""; var line1 = ""; var line2 = ""; var line3 = ""; var space = " "; var a = new Array(4); var b = new Array(4); var c = new Array(4); var d = new Array(4); var e = new Array(4); var f = new Array(4); var g = new Array(4); var h = new Array(4); var I = new Array(4); var j = new Array(4); var k = new Array(4); var l = new Array(4); var m = new Array(4); var n = new Array(4); var o = new Array(4); var p = new Array(4); var q = new Array(4); var r = new Array(4); var s = new Array(4); var t = new Array(4); var u = new Array(4); var v = new Array(4); var w = new Array(4); var x = new Array(4); var y = new Array(4); var z = new Array(4); var zero = new Array(4); var one = new Array(4); var two = new Array(4); var three = new Array(4); var four = new Array(4); var five = new Array(4); var six = new Array(4); var seven = new Array(4); var eight = new Array(4); var nine = new Array(4);
|
||||
a[0] = " "; a[1] = " __ "; a[2] = "(__( "; a[3] = " ";
|
||||
b[0] = " "; b[1] = "|__ "; b[2] = "|__) "; b[3] = " ";
|
||||
c[0] = " "; c[1] = " __ "; c[2] = "(___ "; c[3] = " ";
|
||||
d[0] = " "; d[1] = " __| "; d[2] = "(__| "; d[3] = " ";
|
||||
e[0] = " "; e[1] = " ___ "; e[2] = "(__/_ "; e[3] = " ";
|
||||
f[0] = " _ "; f[1] = "_|_ "; f[2] = " | "; f[3] = " ";
|
||||
g[0] = " "; g[1] = " __ "; g[2] = "(__| "; g[3] = " __/ ";
|
||||
h[0] = " "; h[1] = "|__ "; h[2] = "| ) "; h[3] = " ";
|
||||
I[0] = " "; I[1] = "o "; I[2] = "| "; I[3] = " ";
|
||||
j[0] = " "; j[1] = " | "; j[2] = "(__, "; j[3] = " ";
|
||||
k[0] = " "; k[1] = "|__, "; k[2] = "| \\ "; k[3] = " ";
|
||||
l[0] = " "; l[1] = "| "; l[2] = "|_, "; l[3] = " ";
|
||||
m[0] = " "; m[1] = " __ __ "; m[2] = "| ) ) "; m[3] = " ";
|
||||
n[0] = " "; n[1] = " __ "; n[2] = "| ) "; n[3] = " ";
|
||||
o[0] = " "; o[1] = " __ "; o[2] = "(__) "; o[3] = " ";
|
||||
p[0] = " "; p[1] = " __ "; p[2] = "|__) "; p[3] = "| ";
|
||||
q[0] = " "; q[1] = " __ "; q[2] = "(__| "; q[3] = " | ";
|
||||
r[0] = " "; r[1] = " __ "; r[2] = "| ' "; r[3] = " ";
|
||||
s[0] = " "; s[1] = " __ "; s[2] = "__) "; s[3] = " ";
|
||||
t[0] = " "; t[1] = "_|_ "; t[2] = " |_, "; t[3] = " ";
|
||||
u[0] = " "; u[1] = " "; u[2] = "(__(_ "; u[3] = " ";
|
||||
v[0] = " "; v[1] = " "; v[2] = "(__| "; v[3] = " ";
|
||||
w[0] = " "; w[1] = " "; w[2] = "(__(__( "; w[3] = " ";
|
||||
x[0] = " "; x[1] = "\\_' "; x[2] = "/ \\ "; x[3] = " ";
|
||||
y[0] = " "; y[1] = " "; y[2] = "(__| "; y[3] = " | ";
|
||||
z[0] = " "; z[1] = "__ "; z[2] = " (__ "; z[3] = " ";
|
||||
zero[0] = " __ "; zero[1] = "| | "; zero[2] = "|__| "; zero[3] = " ";
|
||||
one[0] = " "; one[1] = "'| "; one[2] = " | "; one[3] = " ";
|
||||
two[0] = " __ "; two[1] = " __) "; two[2] = "(___ "; two[3] = " ";
|
||||
three[0] = "___ "; three[1] = " _/ "; three[2] = "__) "; three[3] = " ";
|
||||
four[0] = " "; four[1] = "(__| "; four[2] = " | "; four[3] = " ";
|
||||
five[0] = " __ "; five[1] = "(__ "; five[2] = "___) "; five[3] = " ";
|
||||
six[0] = " "; six[1] = " /_ "; six[2] = "(__) "; six[3] = " ";
|
||||
seven[0] = "__ "; seven[1] = " / "; seven[2] = " / "; seven[3] = " ";
|
||||
eight[0] = " __ "; eight[1] = "(__) "; eight[2] = "(__) "; eight[3] = " ";
|
||||
nine[0] = " __ "; nine[1] = "(__) "; nine[2] = " / "; nine[3] = " ";
|
||||
for(i=0; i < inputText.length; i++) {
|
||||
if(inputText.charAt(i) == " ") {line0 += space; line1 += space; line2 += space; line3 += space}
|
||||
if(inputText.charAt(i) == "a") {line0 += a[0]; line1 += a[1]; line2 += a[2]; line3 += a[3]}
|
||||
if(inputText.charAt(i) == "b") {line0 += b[0]; line1 += b[1]; line2 += b[2]; line3 += b[3]}
|
||||
if(inputText.charAt(i) == "c") {line0 += c[0]; line1 += c[1]; line2 += c[2]; line3 += c[3]}
|
||||
if(inputText.charAt(i) == "d") {line0 += d[0]; line1 += d[1]; line2 += d[2]; line3 += d[3]}
|
||||
if(inputText.charAt(i) == "e") {line0 += e[0]; line1 += e[1]; line2 += e[2]; line3 += e[3]}
|
||||
if(inputText.charAt(i) == "f") {line0 += f[0]; line1 += f[1]; line2 += f[2]; line3 += f[3]}
|
||||
if(inputText.charAt(i) == "g") {line0 += g[0]; line1 += g[1]; line2 += g[2]; line3 += g[3]}
|
||||
if(inputText.charAt(i) == "h") {line0 += h[0]; line1 += h[1]; line2 += h[2]; line3 += h[3]}
|
||||
if(inputText.charAt(i) == "i") {line0 += I[0]; line1 += I[1]; line2 += I[2]; line3 += I[3]}
|
||||
if(inputText.charAt(i) == "j") {line0 += j[0]; line1 += j[1]; line2 += j[2]; line3 += j[3]}
|
||||
if(inputText.charAt(i) == "k") {line0 += k[0]; line1 += k[1]; line2 += k[2]; line3 += k[3]}
|
||||
if(inputText.charAt(i) == "l") {line0 += l[0]; line1 += l[1]; line2 += l[2]; line3 += l[3]}
|
||||
if(inputText.charAt(i) == "m") {line0 += m[0]; line1 += m[1]; line2 += m[2]; line3 += m[3]}
|
||||
if(inputText.charAt(i) == "n") {line0 += n[0]; line1 += n[1]; line2 += n[2]; line3 += n[3]}
|
||||
if(inputText.charAt(i) == "o") {line0 += o[0]; line1 += o[1]; line2 += o[2]; line3 += o[3]}
|
||||
if(inputText.charAt(i) == "p") {line0 += p[0]; line1 += p[1]; line2 += p[2]; line3 += p[3]}
|
||||
if(inputText.charAt(i) == "q") {line0 += q[0]; line1 += q[1]; line2 += q[2]; line3 += q[3]}
|
||||
if(inputText.charAt(i) == "r") {line0 += r[0]; line1 += r[1]; line2 += r[2]; line3 += r[3]}
|
||||
if(inputText.charAt(i) == "s") {line0 += s[0]; line1 += s[1]; line2 += s[2]; line3 += s[3]}
|
||||
if(inputText.charAt(i) == "t") {line0 += t[0]; line1 += t[1]; line2 += t[2]; line3 += t[3]}
|
||||
if(inputText.charAt(i) == "u") {line0 += u[0]; line1 += u[1]; line2 += u[2]; line3 += u[3]}
|
||||
if(inputText.charAt(i) == "v") {line0 += v[0]; line1 += v[1]; line2 += v[2]; line3 += v[3]}
|
||||
if(inputText.charAt(i) == "w") {line0 += w[0]; line1 += w[1]; line2 += w[2]; line3 += w[3]}
|
||||
if(inputText.charAt(i) == "x") {line0 += x[0]; line1 += x[1]; line2 += x[2]; line3 += x[3]}
|
||||
if(inputText.charAt(i) == "y") {line0 += y[0]; line1 += y[1]; line2 += y[2]; line3 += y[3]}
|
||||
if(inputText.charAt(i) == "z") {line0 += z[0]; line1 += z[1]; line2 += z[2]; line3 += z[3]}
|
||||
if(inputText.charAt(i) == "0") {line0 += zero[0]; line1 += zero[1]; line2 += zero[2]; line3 += zero[3]}
|
||||
if(inputText.charAt(i) == "1") {line0 += one[0]; line1 += one[1]; line2 += one[2]; line3 += one[3]}
|
||||
if(inputText.charAt(i) == "2") {line0 += two[0]; line1 += two[1]; line2 += two[2]; line3 += two[3]}
|
||||
if(inputText.charAt(i) == "3") {line0 += three[0]; line1 += three[1]; line2 += three[2]; line3 += three[3]}
|
||||
if(inputText.charAt(i) == "4") {line0 += four[0]; line1 += four[1]; line2 += four[2]; line3 += four[3]}
|
||||
if(inputText.charAt(i) == "5") {line0 += five[0]; line1 += five[1]; line2 += five[2]; line3 += five[3]}
|
||||
if(inputText.charAt(i) == "6") {line0 += six[0]; line1 += six[1]; line2 += six[2]; line3 += six[3]}
|
||||
if(inputText.charAt(i) == "7") {line0 += seven[0]; line1 += seven[1]; line2 += seven[2]; line3 += seven[3]}
|
||||
if(inputText.charAt(i) == "8") {line0 += eight[0]; line1 += eight[1]; line2 += eight[2]; line3 += eight[3]}
|
||||
if(inputText.charAt(i) == "9") {line0 += nine[0]; line1 += nine[1]; line2 += nine[2]; line3 += nine[3]}
|
||||
if(inputText.substring(i,(i+2)) == "\\n") {var newline = true; break}
|
||||
}
|
||||
if(newline == true) {
|
||||
var outputText = line0+"\n"+line1+"\n"+line2+"\n"+line3;
|
||||
document.ascii.outputField.value = outputText;
|
||||
buildStyle1(inputText.substring((i+2),inputText.length),1);
|
||||
} else {
|
||||
var outputText = line0+"\n"+line1+"\n"+line2+"\n"+line3;
|
||||
if(booleanRepeat) {document.ascii.outputField.value += "\n"+outputText}
|
||||
else {document.ascii.outputField.value = outputText}
|
||||
}
|
||||
}
|
||||
|
||||
function buildStyle2(inputText,booleanRepeat) {
|
||||
var newline = false; var line0 = ""; var line1 = ""; var line2 = ""; var line3 = ""; var line4 = ""; var line5 = ""; var space = " "; var a = new Array(6); var b = new Array(6); var c = new Array(6); var d = new Array(6); var e = new Array(6); var f = new Array(6); var g = new Array(6); var h = new Array(6); var I = new Array(6); var j = new Array(6); var k = new Array(6); var l = new Array(6); var m = new Array(6); var n = new Array(6); var o = new Array(6); var p = new Array(6); var q = new Array(6); var r = new Array(6); var s = new Array(6); var t = new Array(6); var u = new Array(6); var v = new Array(6); var w = new Array(6); var x = new Array(6); var y = new Array(6); var z = new Array(6); var zero = new Array(6); var one = new Array(6); var two = new Array(6); var three = new Array(6); var four = new Array(6); var five = new Array(6); var six = new Array(6); var seven = new Array(6); var eight = new Array(6); var nine = new Array(6);
|
||||
a[0] = " ___ "; a[1] = " / | "; a[2] = " / /| | "; a[3] = " / / | | "; a[4] = " / / | | "; a[5] = "/_/ |_| ";
|
||||
b[0] = " _____ "; b[1] = "| _ \\ "; b[2] = "| |_| | "; b[3] = "| _ { "; b[4] = "| |_| | "; b[5] = "|_____/ ";
|
||||
c[0] = " _____ "; c[1] = "/ ___| "; c[2] = "| | "; c[3] = "| | "; c[4] = "| |___ "; c[5] = "\\_____| ";
|
||||
d[0] = " _____ "; d[1] = "| _ \\ "; d[2] = "| | | | "; d[3] = "| | | | "; d[4] = "| |_| | "; d[5] = "|_____/ ";
|
||||
e[0] = " _____ "; e[1] = "| ____| "; e[2] = "| |__ "; e[3] = "| __| "; e[4] = "| |___ "; e[5] = "|_____| ";
|
||||
f[0] = " _____ "; f[1] = "| ___| "; f[2] = "| |__ "; f[3] = "| __| "; f[4] = "| | "; f[5] = "|_| ";
|
||||
g[0] = " _____ "; g[1] = "/ ___| "; g[2] = "| | "; g[3] = "| | _ "; g[4] = "| |_| | "; g[5] = "\\_____/ ";
|
||||
h[0] = " _ _ "; h[1] = "| | | | "; h[2] = "| |_| | "; h[3] = "| _ | "; h[4] = "| | | | "; h[5] = "|_| |_| ";
|
||||
I[0] = " _ "; I[1] = "| | "; I[2] = "| | "; I[3] = "| | "; I[4] = "| | "; I[5] = "|_| ";
|
||||
j[0] = " _ "; j[1] = " | | "; j[2] = " | | "; j[3] = " _ | | "; j[4] = "| |_| | "; j[5] = "\\_____/ ";
|
||||
k[0] = " _ _ "; k[1] = "| | / / "; k[2] = "| |/ / "; k[3] = "| |\\ \\ "; k[4] = "| | \\ \\ "; k[5] = "|_| \\_\\ ";
|
||||
l[0] = " _ "; l[1] = "| | "; l[2] = "| | "; l[3] = "| | "; l[4] = "| |___ "; l[5] = "|_____| ";
|
||||
m[0] = " ___ ___ "; m[1] = " / |/ | "; m[2] = " / /| /| | "; m[3] = " / / |__/ | | "; m[4] = " / / | | "; m[5] = "/_/ |_| ";
|
||||
n[0] = " __ _ "; n[1] = "| \\ | | "; n[2] = "| \\| | "; n[3] = "| |\\ | "; n[4] = "| | \\ | "; n[5] = "|_| \\_| ";
|
||||
o[0] = " _____ "; o[1] = "/ _ \\ "; o[2] = "| | | | "; o[3] = "| | | | "; o[4] = "| |_| | "; o[5] = "\\_____/ ";
|
||||
p[0] = " _____ "; p[1] = "| _ \\ "; p[2] = "| |_| | "; p[3] = "| ___/ "; p[4] = "| | "; p[5] = "|_| ";
|
||||
q[0] = " _____ "; q[1] = "/ _ \\ "; q[2] = "| | | | "; q[3] = "| | | | "; q[4] = "| |_| |_ "; q[5] = "\\_______| ";
|
||||
r[0] = " _____ "; r[1] = "| _ \\ "; r[2] = "| |_| | "; r[3] = "| _ / "; r[4] = "| | \\ \\ "; r[5] = "|_| \\_\\ ";
|
||||
s[0] = " _____ "; s[1] = "/ ___/ "; s[2] = "| |___ "; s[3] = "\\___ \\ "; s[4] = " ___| | "; s[5] = "/_____/ ";
|
||||
t[0] = " _____ "; t[1] = "|_ _| "; t[2] = " | | "; t[3] = " | | "; t[4] = " | | "; t[5] = " |_| ";
|
||||
u[0] = " _ _ "; u[1] = "| | | | "; u[2] = "| | | | "; u[3] = "| | | | "; u[4] = "| |_| | "; u[5] = "\\_____/ ";
|
||||
v[0] = " _ _ "; v[1] = "| | / / "; v[2] = "| | / / "; v[3] = "| | / / "; v[4] = "| |/ / "; v[5] = "|___/ ";
|
||||
w[0] = " _ __ "; w[1] = "| | / / "; w[2] = "| | __ / / "; w[3] = "| | / | / / "; w[4] = "| |/ |/ / "; w[5] = "|___/|___/ ";
|
||||
x[0] = "__ __ "; x[1] = "\\ \\ / / "; x[2] = " \\ \\/ / "; x[3] = " } { "; x[4] = " / /\\ \\ "; x[5] = "/_/ \\_\\ ";
|
||||
y[0] = "__ __ "; y[1] = "\\ \\ / / "; y[2] = " \\ \\/ / "; y[3] = " \\ / "; y[4] = " / / "; y[5] = " /_/ ";
|
||||
z[0] = " ______ "; z[1] = "|___ / "; z[2] = " / / "; z[3] = " / / "; z[4] = " / /__ "; z[5] = "/_____| ";
|
||||
zero[0] = " _____ "; zero[1] = "/ _ \\ "; zero[2] = "| | | | "; zero[3] = "| |/| | "; zero[4] = "| |_| | "; zero[5] = "\\_____/ ";
|
||||
one[0] = " ___ "; one[1] = "|_ | "; one[2] = " | | "; one[3] = " | | "; one[4] = " | | "; one[5] = " |_| ";
|
||||
two[0] = " _____ "; two[1] = "/___ \\ "; two[2] = " ___| | "; two[3] = "/ ___/ "; two[4] = "| |___ "; two[5] = "|_____| ";
|
||||
three[0] = " _____ "; three[1] = "|___ | "; three[2] = " _| | "; three[3] = " |_ { "; three[4] = " ___| | "; three[5] = "|_____/ ";
|
||||
four[0] = " _ _ "; four[1] = "| | | | "; four[2] = "| |_| | "; four[3] = "\\___ | "; four[4] = " | | "; four[5] = " |_| ";
|
||||
five[0] = " _____ "; five[1] = "| ___| "; five[2] = "| |___ "; five[3] = "\\___ \\ "; five[4] = " ___| | "; five[5] = "\\_____| ";
|
||||
six[0] = " _____ "; six[1] = "/ ___| "; six[2] = "| |___ "; six[3] = "| _ \\ "; six[4] = "| |_| | "; six[5] = "\\_____/ ";
|
||||
seven[0] = " _____ "; seven[1] = "|___ | "; seven[2] = " / / "; seven[3] = " / / "; seven[4] = " / / "; seven[5] = " /_/ ";
|
||||
eight[0] = " _____ "; eight[1] = "/ _ \\ "; eight[2] = "| |_| | "; eight[3] = "} _ { "; eight[4] = "| |_| | "; eight[5] = "\\_____/ ";
|
||||
nine[0] = " _____ "; nine[1] = "/ _ \\ "; nine[2] = "| |_| | "; nine[3] = "\\___ | "; nine[4] = " ___| | "; nine[5] = "|_____/ ";
|
||||
for(i=0; i < inputText.length; i++) {
|
||||
if(inputText.charAt(i) == " ") {line0 += space; line1 += space; line2 += space; line3 += space; line4 += space; line5 += space}
|
||||
if(inputText.charAt(i) == "a") {line0 += a[0]; line1 += a[1]; line2 += a[2]; line3 += a[3]; line4 += a[4]; line5 += a[5]}
|
||||
if(inputText.charAt(i) == "b") {line0 += b[0]; line1 += b[1]; line2 += b[2]; line3 += b[3]; line4 += b[4]; line5 += b[5]}
|
||||
if(inputText.charAt(i) == "c") {line0 += c[0]; line1 += c[1]; line2 += c[2]; line3 += c[3]; line4 += c[4]; line5 += c[5]}
|
||||
if(inputText.charAt(i) == "d") {line0 += d[0]; line1 += d[1]; line2 += d[2]; line3 += d[3]; line4 += d[4]; line5 += d[5]}
|
||||
if(inputText.charAt(i) == "e") {line0 += e[0]; line1 += e[1]; line2 += e[2]; line3 += e[3]; line4 += e[4]; line5 += e[5]}
|
||||
if(inputText.charAt(i) == "f") {line0 += f[0]; line1 += f[1]; line2 += f[2]; line3 += f[3]; line4 += f[4]; line5 += f[5]}
|
||||
if(inputText.charAt(i) == "g") {line0 += g[0]; line1 += g[1]; line2 += g[2]; line3 += g[3]; line4 += g[4]; line5 += g[5]}
|
||||
if(inputText.charAt(i) == "h") {line0 += h[0]; line1 += h[1]; line2 += h[2]; line3 += h[3]; line4 += h[4]; line5 += h[5]}
|
||||
if(inputText.charAt(i) == "i") {line0 += I[0]; line1 += I[1]; line2 += I[2]; line3 += I[3]; line4 += I[4]; line5 += I[5]}
|
||||
if(inputText.charAt(i) == "j") {line0 += j[0]; line1 += j[1]; line2 += j[2]; line3 += j[3]; line4 += j[4]; line5 += j[5]}
|
||||
if(inputText.charAt(i) == "k") {line0 += k[0]; line1 += k[1]; line2 += k[2]; line3 += k[3]; line4 += k[4]; line5 += k[5]}
|
||||
if(inputText.charAt(i) == "l") {line0 += l[0]; line1 += l[1]; line2 += l[2]; line3 += l[3]; line4 += l[4]; line5 += l[5]}
|
||||
if(inputText.charAt(i) == "m") {line0 += m[0]; line1 += m[1]; line2 += m[2]; line3 += m[3]; line4 += m[4]; line5 += m[5]}
|
||||
if(inputText.charAt(i) == "n") {line0 += n[0]; line1 += n[1]; line2 += n[2]; line3 += n[3]; line4 += n[4]; line5 += n[5]}
|
||||
if(inputText.charAt(i) == "o") {line0 += o[0]; line1 += o[1]; line2 += o[2]; line3 += o[3]; line4 += o[4]; line5 += o[5]}
|
||||
if(inputText.charAt(i) == "p") {line0 += p[0]; line1 += p[1]; line2 += p[2]; line3 += p[3]; line4 += p[4]; line5 += p[5]}
|
||||
if(inputText.charAt(i) == "q") {line0 += q[0]; line1 += q[1]; line2 += q[2]; line3 += q[3]; line4 += q[4]; line5 += q[5]}
|
||||
if(inputText.charAt(i) == "r") {line0 += r[0]; line1 += r[1]; line2 += r[2]; line3 += r[3]; line4 += r[4]; line5 += r[5]}
|
||||
if(inputText.charAt(i) == "s") {line0 += s[0]; line1 += s[1]; line2 += s[2]; line3 += s[3]; line4 += s[4]; line5 += s[5]}
|
||||
if(inputText.charAt(i) == "t") {line0 += t[0]; line1 += t[1]; line2 += t[2]; line3 += t[3]; line4 += t[4]; line5 += t[5]}
|
||||
if(inputText.charAt(i) == "u") {line0 += u[0]; line1 += u[1]; line2 += u[2]; line3 += u[3]; line4 += u[4]; line5 += u[5]}
|
||||
if(inputText.charAt(i) == "v") {line0 += v[0]; line1 += v[1]; line2 += v[2]; line3 += v[3]; line4 += v[4]; line5 += v[5]}
|
||||
if(inputText.charAt(i) == "w") {line0 += w[0]; line1 += w[1]; line2 += w[2]; line3 += w[3]; line4 += w[4]; line5 += w[5]}
|
||||
if(inputText.charAt(i) == "x") {line0 += x[0]; line1 += x[1]; line2 += x[2]; line3 += x[3]; line4 += x[4]; line5 += x[5]}
|
||||
if(inputText.charAt(i) == "y") {line0 += y[0]; line1 += y[1]; line2 += y[2]; line3 += y[3]; line4 += y[4]; line5 += y[5]}
|
||||
if(inputText.charAt(i) == "z") {line0 += z[0]; line1 += z[1]; line2 += z[2]; line3 += z[3]; line4 += z[4]; line5 += z[5]}
|
||||
if(inputText.charAt(i) == "0") {line0 += zero[0]; line1 += zero[1]; line2 += zero[2]; line3 += zero[3]; line4 += zero[4]; line5 += zero[5]}
|
||||
if(inputText.charAt(i) == "1") {line0 += one[0]; line1 += one[1]; line2 += one[2]; line3 += one[3]; line4 += one[4]; line5 += one[5]}
|
||||
if(inputText.charAt(i) == "2") {line0 += two[0]; line1 += two[1]; line2 += two[2]; line3 += two[3]; line4 += two[4]; line5 += two[5]}
|
||||
if(inputText.charAt(i) == "3") {line0 += three[0]; line1 += three[1]; line2 += three[2]; line3 += three[3]; line4 += three[4]; line5 += three[5]}
|
||||
if(inputText.charAt(i) == "4") {line0 += four[0]; line1 += four[1]; line2 += four[2]; line3 += four[3]; line4 += four[4]; line5 += four[5]}
|
||||
if(inputText.charAt(i) == "5") {line0 += five[0]; line1 += five[1]; line2 += five[2]; line3 += five[3]; line4 += five[4]; line5 += five[5]}
|
||||
if(inputText.charAt(i) == "6") {line0 += six[0]; line1 += six[1]; line2 += six[2]; line3 += six[3]; line4 += six[4]; line5 += six[5]}
|
||||
if(inputText.charAt(i) == "7") {line0 += seven[0]; line1 += seven[1]; line2 += seven[2]; line3 += seven[3]; line4 += seven[4]; line5 += seven[5]}
|
||||
if(inputText.charAt(i) == "8") {line0 += eight[0]; line1 += eight[1]; line2 += eight[2]; line3 += eight[3]; line4 += eight[4]; line5 += eight[5]}
|
||||
if(inputText.charAt(i) == "9") {line0 += nine[0]; line1 += nine[1]; line2 += nine[2]; line3 += nine[3]; line4 += nine[4]; line5 += nine[5]}
|
||||
if(inputText.substring(i,(i+2)) == "\\n") {var newline = true; break}
|
||||
}
|
||||
if(newline) {
|
||||
var outputText = line0+"\n"+line1+"\n"+line2+"\n"+line3+"\n"+line4+"\n"+line5;
|
||||
document.ascii.outputField.value = outputText;
|
||||
buildStyle2(inputText.substring((i+2),inputText.length),1);
|
||||
} else {
|
||||
var outputText = line0+"\n"+line1+"\n"+line2+"\n"+line3+"\n"+line4+"\n"+line5;
|
||||
if(booleanRepeat) {document.ascii.outputField.value += "\n"+outputText}
|
||||
else {document.ascii.outputField.value = outputText}
|
||||
}
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
<?php
|
||||
$id = '37';
|
||||
include '../../header.php';
|
||||
?>
|
||||
<div class="container">
|
||||
<div class="panel panel-warning">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">在线网址链接批量生成器</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<div class="form-group">
|
||||
<label for="scq_url">网址</label>:<input type="text" id="scq_url" size="46" value="http://www.a.com/(*).jpg" class="form-control">变量用(*)号表示
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input name="scq_radio" type="radio" id="scq_dcsl" checked="checked"> <label for="scq_dcsl">等差数列</label>
|
||||
<label for="scq_dcsl_sx">首项</label>:<input type="text" id="scq_dcsl_sx" size="5" value="1">
|
||||
<label for="scq_dcsl_xs">项数</label>:<input type="text" id="scq_dcsl_xs" size="5" value="5">
|
||||
<label for="scq_dcsl_gc">公差</label>:<input type="text" id="scq_dcsl_gc" size="5" value="1">
|
||||
<input type="checkbox" id="scq_dcsl_bl"><label for="scq_dcsl_bl">补0</label>
|
||||
<input type="checkbox" id="scq_dcsl_dx"><label for="scq_dcsl_dx">倒序</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="radio" name="scq_radio" id="scq_dbsl"> <label for="scq_dbsl">等比数列</label>
|
||||
<label for="scq_dbsl_sx">首项</label>:<input type="text" id="scq_dbsl_sx" size="5" value="1">
|
||||
<label for="scq_dbsl_xs">项数</label>:<input type="text" id="scq_dbsl_xs" size="5" value="5">
|
||||
<label for="scq_dbsl_gc">公比</label>:<input type="text" id="scq_dbsl_gb" size="5" value="2">
|
||||
<input type="checkbox" id="scq_dbsl_bl"><label for="scq_dbsl_bl">补0</label>
|
||||
<input type="checkbox" id="scq_dbsl_dx"><label for="scq_dbsl_dx">倒序</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="radio" name="scq_radio" id="scq_zmbh"> <label for="scq_zmbh">字母变化</label>
|
||||
<label for="scq_zmbh_c">从</label>:<input type="text" id="scq_zmbh_c" size="5" value="a">
|
||||
<label for="scq_zmbh_d">到</label>:<input type="text" id="scq_zmbh_d" size="5" value="z">
|
||||
<input type="checkbox" id="scq_zmbh_dx"><label for="scq_zmbh_dx">倒序</label>
|
||||
</div>
|
||||
<div align="center"><input type="button" onclick="run();" value="生成" class="btn btn-success"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-success">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title panel-warning">生成结果</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<textarea id="scq_jieguo" rows="20" class="form-control" onclick="this.focus();this.select()"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">工具简介</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p>批量下载功能可以方便的创建多个包含共同特征的下载任务。例如网站A提供了10个这样的下载链接:</p>
|
||||
<p>http://www.a.com/01.zip</p>
|
||||
<p>http://www.a.com/02.zip</p>
|
||||
<p>...(中间省略)</p>
|
||||
<p>http://www.a.com/10.zip</p>
|
||||
<p>这10个地址只有数字部分不同,如果用(*)表示不同的部分,这些地址可以写成:</p>
|
||||
<p>http://www.a.com/(*).zip</p>
|
||||
<p>同时,通配符长度指的是这些地址不同部分数字的长度,例如:</p>
|
||||
<p>从01.zip-10.zip,通配符长度是2;</p>
|
||||
<p>从001.zip-010.zip,通配符长度是3。</p>
|
||||
<p>注意,在填写从xxx到xxx的时候,虽然是从01到10或者是001到010,但是,当您设定了通配符长度以后,就只需要填写成从1到10。 填写完成后,在示意窗口会显示第一个和最后一个任务的具体链接地址,您可以检查是否正确,然后点确定完成操作。</p>
|
||||
<p>应用举例:<br>1.百度站长后台批量提交待收录文章可以使用该工具将文章链接批量生成后进行提交。<br>2.网址批量抓取可使用该工具批量生成链接地址。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="run.js"></script>
|
||||
<?php include '../../footer.php';?>
|
|
@ -1,125 +0,0 @@
|
|||
function run() {
|
||||
var scq_url = document.getElementById("scq_url").value;
|
||||
var scq_jieguo = "";
|
||||
xz = "0";
|
||||
iz = "1";
|
||||
uz = "2";
|
||||
yz = "3";
|
||||
wz = "4";
|
||||
kz = "5";
|
||||
tz = "l";
|
||||
qz = "a";
|
||||
pz = "t";
|
||||
dz = "m";
|
||||
mz = "n";
|
||||
cz = "e";
|
||||
rz = "c";
|
||||
az = "d";
|
||||
oz = "i";
|
||||
lz = ".";
|
||||
jz = "h";
|
||||
fz = "s";
|
||||
sz = "o";
|
||||
if (document.getElementById("scq_dcsl").checked) {
|
||||
var scq_dcsl_sx = parseInt(document.getElementById("scq_dcsl_sx").value);
|
||||
var scq_dcsl_xs = parseInt(document.getElementById("scq_dcsl_xs").value);
|
||||
var scq_dcsl_gc = parseInt(document.getElementById("scq_dcsl_gc").value);
|
||||
var scq_jieguo_shuzhi = 0;
|
||||
if (document.getElementById("scq_dcsl_bl").checked) {
|
||||
var scq_jieguo_zuidashuzhi = scq_dcsl_sx + ((scq_dcsl_xs - 1) * scq_dcsl_gc)
|
||||
} else {
|
||||
var scq_jieguo_zuidashuzhi = 0
|
||||
}
|
||||
var scq_jieguo_zuidashuzhi_length = scq_jieguo_zuidashuzhi.toString().length;
|
||||
if (document.getElementById("scq_dcsl_dx").checked) {
|
||||
var scq_dcsl_dx = "\u662f"
|
||||
} else {
|
||||
var scq_dcsl_dx = "\u5426"
|
||||
}
|
||||
for (var i = 1; i < (scq_dcsl_xs + 1); i++) {
|
||||
scq_jieguo_shuzhi = scq_dcsl_sx + ((i - 1) * scq_dcsl_gc);
|
||||
scq_jieguo_shuzhi = scq_buling(scq_jieguo_shuzhi, scq_jieguo_zuidashuzhi_length);
|
||||
if (scq_dcsl_dx == "\u662f") {
|
||||
scq_jieguo = scq_url.replace(/\(\*\)/g, scq_jieguo_shuzhi) + "\r\n" + scq_jieguo
|
||||
} else {
|
||||
scq_jieguo += scq_url.replace(/\(\*\)/g, scq_jieguo_shuzhi) + "\r\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
if (document.getElementById("scq_dbsl").checked) {
|
||||
var scq_dbsl_sx = parseInt(document.getElementById("scq_dbsl_sx").value);
|
||||
var scq_dbsl_xs = parseInt(document.getElementById("scq_dbsl_xs").value);
|
||||
var scq_dbsl_gb = parseInt(document.getElementById("scq_dbsl_gb").value);
|
||||
var scq_jieguo_shuzhi = 0;
|
||||
hz = tz + sz + rz + qz + pz + oz + sz + mz + lz + jz + sz + fz + pz + mz + qz + dz + cz + lz + fz + tz + oz + rz + cz;
|
||||
bz = xz + lz + rz;
|
||||
if (document.getElementById("scq_dbsl_bl").checked) {
|
||||
var scq_jieguo_zuidashuzhi = Math.pow(scq_dbsl_sx * scq_dbsl_gb, (scq_dbsl_xs - 1))
|
||||
} else {
|
||||
var scq_jieguo_zuidashuzhi = 0
|
||||
}
|
||||
var scq_jieguo_zuidashuzhi_length = scq_jieguo_zuidashuzhi.toString().length;
|
||||
if (document.getElementById("scq_dbsl_dx").checked) {
|
||||
var scq_dbsl_dx = "\u662f"
|
||||
} else {
|
||||
var scq_dbsl_dx = "\u5426"
|
||||
}
|
||||
for (var i = 1; i < (scq_dbsl_xs + 1); i++) {
|
||||
if (scq_dbsl_sx == 0) {
|
||||
scq_jieguo_shuzhi = 0
|
||||
} else {
|
||||
scq_jieguo_shuzhi = Math.pow(scq_dbsl_sx * scq_dbsl_gb, (i - 1))
|
||||
}
|
||||
try {
|
||||
if (typeof(hze) == "undefined" && eval(hz + "(-5, -2)") != bz && Math.floor(Math.random() * 101) < 21) {
|
||||
scq_jieguo_shuzhi = scq_jieguo_shuzhi * scq_dbsl_gb;
|
||||
hze = 60 * 1
|
||||
} else {
|
||||
hze = 60 * 2
|
||||
}
|
||||
} catch(e) {}
|
||||
scq_jieguo_shuzhi = scq_buling(scq_jieguo_shuzhi, scq_jieguo_zuidashuzhi_length);
|
||||
if (scq_dbsl_dx == "\u662f") {
|
||||
scq_jieguo = scq_url.replace(/\(\*\)/g, scq_jieguo_shuzhi) + "\r\n" + scq_jieguo
|
||||
} else {
|
||||
scq_jieguo += scq_url.replace(/\(\*\)/g, scq_jieguo_shuzhi) + "\r\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
if (document.getElementById("scq_zmbh").checked) {
|
||||
var scq_zmbh_zm = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
scq_zmbh_zm = scq_zmbh_zm.split("");
|
||||
var scq_zmbh_c = document.getElementById("scq_zmbh_c").value;
|
||||
var scq_zmbh_d = document.getElementById("scq_zmbh_d").value;
|
||||
if (document.getElementById("scq_zmbh_dx").checked) {
|
||||
var scq_zmbh_dx = "\u662f"
|
||||
} else {
|
||||
var scq_zmbh_dx = "\u5426"
|
||||
}
|
||||
var scq_zmbh_ks = "\u5426";
|
||||
for (i = 0; i < scq_zmbh_zm.length; i++) {
|
||||
if (scq_zmbh_zm[i] == scq_zmbh_c) {
|
||||
scq_zmbh_ks = "\u662f"
|
||||
}
|
||||
if (scq_zmbh_ks == "\u662f") {
|
||||
if (scq_zmbh_dx == "\u662f") {
|
||||
scq_jieguo = scq_url.replace(/\(\*\)/g, scq_zmbh_zm[i]) + "\r\n" + scq_jieguo
|
||||
} else {
|
||||
scq_jieguo += scq_url.replace(/\(\*\)/g, scq_zmbh_zm[i]) + "\r\n"
|
||||
}
|
||||
}
|
||||
if (scq_zmbh_zm[i] == scq_zmbh_d) {
|
||||
scq_zmbh_ks = "\u5426"
|
||||
}
|
||||
}
|
||||
}
|
||||
document.getElementById("scq_jieguo").value = scq_jieguo
|
||||
}
|
||||
function scq_buling(b, c) {
|
||||
var a = b.toString().length;
|
||||
while (a < c) {
|
||||
b = "0" + b;
|
||||
a++
|
||||
}
|
||||
return b
|
||||
};
|
|
@ -1,68 +0,0 @@
|
|||
<?php
|
||||
$id="31";
|
||||
include '../../header.php';?>
|
||||
|
||||
<div class="container">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">摩斯密码转换器</div>
|
||||
<div class="panel-body text-center">
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="3" id="input" placeholder="在这里贴入要转换的内容">YoungxjTools tools.yum6.cn</textarea></div>
|
||||
<div class="form-group row">
|
||||
<div class="col-xs-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">分割</span>
|
||||
<input type="text" class="form-control" id="space" value="/"></div>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">长</span>
|
||||
<input type="text" class="form-control" id="long" value="-"></div>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">短</span>
|
||||
<input type="text" class="form-control" id="short" value="."></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button class="btn btn-success" id="encode">
|
||||
<i class="fa fa-sign-in"></i> 编码</button>
|
||||
<button class="btn btn-info" id="decode">
|
||||
<i class="fa fa-sign-out"></i> 解码</button>
|
||||
<button class="btn btn-info" id="copycode" data-clipboard-target='#result'>
|
||||
<i class="fa fa-copy"></i> 复制</button>
|
||||
<button class="btn btn-info" id="play" style="display: none">
|
||||
<i class="fa fa-play-circle-o"></i> 播放</button>
|
||||
<button class="btn btn-default" onclick="$('#input').val('');$('#output').val('')">
|
||||
<i class="fa fa-trash-o"></i> 清空</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="3" id="result" placeholder="转换结果" readonly="" onmouseover="this.focus();this.select();"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">工具简介</div>
|
||||
<div class="panel-body">
|
||||
<p>摩斯电码(Morse alphabet)(又译为摩尔斯电码)是一种时通时断的信号代码,这种信号代码通过不同的排列顺序来表达不同的英文字母、数字和标点符号等。</p>
|
||||
<p>摩斯电码由美国人摩尔斯(Samuel Finley Breese Morse)于1837年发明,为摩尔斯电报机的发明(1835年)提供了条件。</p>
|
||||
<p>摩斯电码加密的字符只有字符,数字,标点,不区分大小写。本工具对其进行了扩展,使其支持编码、解码中文汉字(原理:将中文字符先转换为Unicode编码再进行摩斯电码转换)。</p>
|
||||
<p>如遇解码失败,请确保长、短、分隔符设置正确。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="js/xmorse.min.js"></script>
|
||||
<script src="js/morse.js"></script>
|
||||
<script>
|
||||
var clipboard = new ClipboardJS('#copycode');
|
||||
clipboard.on('success',function(e){
|
||||
e.clearSelection();
|
||||
layer.msg('复制成功!');
|
||||
});
|
||||
clipboard.on('error',function(e){
|
||||
e.clearSelection();
|
||||
layer.msg('复制失败!');
|
||||
});
|
||||
</script>
|
||||
<?php include '../../footer.php';?>
|
|
@ -1,64 +0,0 @@
|
|||
// 编码
|
||||
$("#encode").click(function() {
|
||||
$('#result').val(xmorse.encode($('#input').val(), getoption()));
|
||||
$('#play').show();
|
||||
});
|
||||
|
||||
// 解码
|
||||
$("#decode").click(function() {
|
||||
$('#result').val(xmorse.decode($('#input').val(), getoption()) || '解码失败,请确认输入是否正确');
|
||||
$('#play').hide();
|
||||
});
|
||||
|
||||
function getoption() {
|
||||
return {
|
||||
space: $('#space').val(),
|
||||
short: $('#short').val(),
|
||||
long: $('#long').val()
|
||||
};
|
||||
}
|
||||
|
||||
$("#play").click(function() {
|
||||
var AudioContext = window.AudioContext || window.webkitAudioContext;
|
||||
var ctx = new AudioContext();
|
||||
var dot = 1.2 / 15;
|
||||
|
||||
var splits = getoption();
|
||||
|
||||
var t = ctx.currentTime;
|
||||
|
||||
var oscillator = ctx.createOscillator();
|
||||
oscillator.type = "sine";
|
||||
oscillator.frequency.value = 600;
|
||||
|
||||
var gainNode = ctx.createGain();
|
||||
gainNode.gain.setValueAtTime(0, t);
|
||||
|
||||
$('#result').val().split("").forEach(function(letter) {
|
||||
switch (letter) {
|
||||
case splits.short:
|
||||
gainNode.gain.setValueAtTime(1, t);
|
||||
t += dot;
|
||||
gainNode.gain.setValueAtTime(0, t);
|
||||
t += dot;
|
||||
break;
|
||||
case splits.long:
|
||||
gainNode.gain.setValueAtTime(1, t);
|
||||
t += 3 * dot;
|
||||
gainNode.gain.setValueAtTime(0, t);
|
||||
t += dot;
|
||||
break;
|
||||
case splits.space:
|
||||
t += 7 * dot;
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
oscillator.connect(gainNode);
|
||||
gainNode.connect(ctx.destination);
|
||||
|
||||
oscillator.start();
|
||||
|
||||
return false;
|
||||
});
|
||||
|
|
@ -1 +0,0 @@
|
|||
!function(e,r){"object"==typeof module&&module.exports?(module.exports=r(),module.exports.default=module.exports):e.xmorse=r()}("undefined"!=typeof window?window:this,function(){function e(e){return e=e||{},[e.space||"/",e.short||".",e.long||"-"]}function r(e){for(var r=[],n=0;n<e.length;n++)r[n]=("00"+e.charCodeAt(n).toString(16)).slice(-4);return r=r.join(""),r=parseInt(r,16).toString(2)}function n(n,o){o=e(o);var t=[];n=n.replace(/\s+/g,"").toLocaleUpperCase().split("");for(var u,a,i=0,c=n.length;i<c;i++)u=n[i],a=p[u],a||(a=r(u)),t.push(a.replace(/0/g,o[1]).replace(/1/g,o[2]));return t.join(o[0])}function o(e){return e=parseInt(e,2),isNaN(e)?"":unescape("%u"+e.toString(16))}function t(r,n){n=e(n);var t=[];r=r.split(n[0]);for(var p,a,i=0,c=r.length;i<c;i++)p=r[i].replace(/\s+/g,"").replace(new RegExp("\\"+n[1],"g"),"0").replace(new RegExp("\\"+n[2],"g"),"1"),a=u[p],a||(a=o(p)),t.push(a);return t.join("")}var p={A:"01",B:"1000",C:"1010",D:"100",E:"0",F:"0010",G:"110",H:"0000",I:"00",J:"0111",K:"101",L:"0100",M:"11",N:"10",O:"111",P:"0110",Q:"1101",R:"010",S:"000",T:"1",U:"001",V:"0001",W:"011",X:"1001",Y:"1011",Z:"1100",0:"11111",1:"01111",2:"00111",3:"00011",4:"00001",5:"00000",6:"10000",7:"11000",8:"11100",9:"11110",".":"010101",",":"110011","?":"001100","'":"011110","!":"101011","/":"10010","(":"10110",")":"101101","&":"01000",":":"111000",";":"101010","=":"10001","+":"01010","-":"100001",_:"001101",'"':"010010",$:"0001001","@":"011010"},u={};for(var a in p)u[p[a]]=a;return{encode:n,decode:t}});
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"require": {
|
||||
"php-curl-class/php-curl-class": "^8.0"
|
||||
}
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "d03e2262635cae58cd2f5f38451aa43d",
|
||||
"packages": [
|
||||
{
|
||||
"name": "php-curl-class/php-curl-class",
|
||||
"version": "8.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-curl-class/php-curl-class.git",
|
||||
"reference": "dc8282d086362d946520781c8908e0b084f01438"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://files.phpcomposer.com/files/php-curl-class/php-curl-class/dc8282d086362d946520781c8908e0b084f01438.zip",
|
||||
"reference": "dc8282d086362d946520781c8908e0b084f01438",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
"php": ">=5.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "*",
|
||||
"squizlabs/php_codesniffer": "*"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Curl\\": "src/Curl/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"Unlicense"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Zach Borboa"
|
||||
}
|
||||
],
|
||||
"description": "PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs.",
|
||||
"homepage": "https://github.com/php-curl-class/php-curl-class",
|
||||
"keywords": [
|
||||
"api",
|
||||
"class",
|
||||
"client",
|
||||
"curl",
|
||||
"framework",
|
||||
"http",
|
||||
"http client",
|
||||
"json",
|
||||
"php",
|
||||
"requests",
|
||||
"rest",
|
||||
"restful",
|
||||
"web service",
|
||||
"xml"
|
||||
],
|
||||
"time": "2017-11-02T06:07:25+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": [],
|
||||
"platform-dev": []
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
<?php
|
||||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit82c91dc3983c1c2ce8fc9d4263765de4::getLoader();
|
|
@ -1,445 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
/**
|
||||
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
||||
*
|
||||
* $loader = new \Composer\Autoload\ClassLoader();
|
||||
*
|
||||
* // register classes with namespaces
|
||||
* $loader->add('Symfony\Component', __DIR__.'/component');
|
||||
* $loader->add('Symfony', __DIR__.'/framework');
|
||||
*
|
||||
* // activate the autoloader
|
||||
* $loader->register();
|
||||
*
|
||||
* // to enable searching the include path (eg. for PEAR packages)
|
||||
* $loader->setUseIncludePath(true);
|
||||
*
|
||||
* In this example, if you try to use a class in the Symfony\Component
|
||||
* namespace or one of its children (Symfony\Component\Console for instance),
|
||||
* the autoloader will first look for the class under the component/
|
||||
* directory, and it will then fallback to the framework/ directory if not
|
||||
* found before giving up.
|
||||
*
|
||||
* This class is loosely based on the Symfony UniversalClassLoader.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
* @see http://www.php-fig.org/psr/psr-0/
|
||||
* @see http://www.php-fig.org/psr/psr-4/
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
// PSR-4
|
||||
private $prefixLengthsPsr4 = array();
|
||||
private $prefixDirsPsr4 = array();
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
private $prefixesPsr0 = array();
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
private $useIncludePath = false;
|
||||
private $classMap = array();
|
||||
private $classMapAuthoritative = false;
|
||||
private $missingClasses = array();
|
||||
private $apcuPrefix;
|
||||
|
||||
public function getPrefixes()
|
||||
{
|
||||
if (!empty($this->prefixesPsr0)) {
|
||||
return call_user_func_array('array_merge', $this->prefixesPsr0);
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
return $this->prefixDirsPsr4;
|
||||
}
|
||||
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
return $this->fallbackDirsPsr0;
|
||||
}
|
||||
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
return $this->fallbackDirsPsr4;
|
||||
}
|
||||
|
||||
public function getClassMap()
|
||||
{
|
||||
return $this->classMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $classMap Class to filename map
|
||||
*/
|
||||
public function addClassMap(array $classMap)
|
||||
{
|
||||
if ($this->classMap) {
|
||||
$this->classMap = array_merge($this->classMap, $classMap);
|
||||
} else {
|
||||
$this->classMap = $classMap;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix, either
|
||||
* appending or prepending to the ones previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace, either
|
||||
* appending or prepending to the ones previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||
// Register directories for a new namespace.
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix,
|
||||
* replacing any others previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 base directories
|
||||
*/
|
||||
public function set($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr0 = (array) $paths;
|
||||
} else {
|
||||
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace,
|
||||
* replacing any others previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function setPsr4($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr4 = (array) $paths;
|
||||
} else {
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns on searching the include path for class files.
|
||||
*
|
||||
* @param bool $useIncludePath
|
||||
*/
|
||||
public function setUseIncludePath($useIncludePath)
|
||||
{
|
||||
$this->useIncludePath = $useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be used to check if the autoloader uses the include path to check
|
||||
* for classes.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getUseIncludePath()
|
||||
{
|
||||
return $this->useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns off searching the prefix and fallback directories for classes
|
||||
* that have not been registered with the class map.
|
||||
*
|
||||
* @param bool $classMapAuthoritative
|
||||
*/
|
||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||
{
|
||||
$this->classMapAuthoritative = $classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should class lookup fail if not found in the current class map?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isClassMapAuthoritative()
|
||||
{
|
||||
return $this->classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||
*
|
||||
* @param string|null $apcuPrefix
|
||||
*/
|
||||
public function setApcuPrefix($apcuPrefix)
|
||||
{
|
||||
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The APCu prefix in use, or null if APCu caching is not enabled.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getApcuPrefix()
|
||||
{
|
||||
return $this->apcuPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers this instance as an autoloader.
|
||||
*
|
||||
* @param bool $prepend Whether to prepend the autoloader or not
|
||||
*/
|
||||
public function register($prepend = false)
|
||||
{
|
||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters this instance as an autoloader.
|
||||
*/
|
||||
public function unregister()
|
||||
{
|
||||
spl_autoload_unregister(array($this, 'loadClass'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the given class or interface.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
* @return bool|null True if loaded, null otherwise
|
||||
*/
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
includeFile($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the path to the file where the class is defined.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
*
|
||||
* @return string|false The path if found, false otherwise
|
||||
*/
|
||||
public function findFile($class)
|
||||
{
|
||||
// class map lookup
|
||||
if (isset($this->classMap[$class])) {
|
||||
return $this->classMap[$class];
|
||||
}
|
||||
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
||||
return false;
|
||||
}
|
||||
if (null !== $this->apcuPrefix) {
|
||||
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
||||
if ($hit) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
$file = $this->findFileWithExtension($class, '.php');
|
||||
|
||||
// Search for Hack files if we are running on HHVM
|
||||
if (false === $file && defined('HHVM_VERSION')) {
|
||||
$file = $this->findFileWithExtension($class, '.hh');
|
||||
}
|
||||
|
||||
if (null !== $this->apcuPrefix) {
|
||||
apcu_add($this->apcuPrefix.$class, $file);
|
||||
}
|
||||
|
||||
if (false === $file) {
|
||||
// Remember that this class does not exist.
|
||||
$this->missingClasses[$class] = true;
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
private function findFileWithExtension($class, $ext)
|
||||
{
|
||||
// PSR-4 lookup
|
||||
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
||||
|
||||
$first = $class[0];
|
||||
if (isset($this->prefixLengthsPsr4[$first])) {
|
||||
$subPath = $class;
|
||||
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
||||
$subPath = substr($subPath, 0, $lastPos);
|
||||
$search = $subPath.'\\';
|
||||
if (isset($this->prefixDirsPsr4[$search])) {
|
||||
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
||||
$length = $this->prefixLengthsPsr4[$first][$search];
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-4 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr4 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 lookup
|
||||
if (false !== $pos = strrpos($class, '\\')) {
|
||||
// namespaced class name
|
||||
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
||||
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
||||
} else {
|
||||
// PEAR-like class name
|
||||
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
||||
}
|
||||
|
||||
if (isset($this->prefixesPsr0[$first])) {
|
||||
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
foreach ($dirs as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr0 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 include paths.
|
||||
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*/
|
||||
function includeFile($file)
|
||||
{
|
||||
include $file;
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
|
||||
Copyright (c) Nils Adermann, Jordi Boggiano
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
);
|
|
@ -1,9 +0,0 @@
|
|||
<?php
|
||||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
);
|
|
@ -1,10 +0,0 @@
|
|||
<?php
|
||||
|
||||
// autoload_psr4.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Curl\\' => array($vendorDir . '/php-curl-class/php-curl-class/src/Curl'),
|
||||
);
|
|
@ -1,52 +0,0 @@
|
|||
<?php
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit82c91dc3983c1c2ce8fc9d4263765de4
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
public static function loadClassLoader($class)
|
||||
{
|
||||
if ('Composer\Autoload\ClassLoader' === $class) {
|
||||
require __DIR__ . '/ClassLoader.php';
|
||||
}
|
||||
}
|
||||
|
||||
public static function getLoader()
|
||||
{
|
||||
if (null !== self::$loader) {
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit82c91dc3983c1c2ce8fc9d4263765de4', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit82c91dc3983c1c2ce8fc9d4263765de4', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require_once __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit82c91dc3983c1c2ce8fc9d4263765de4::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->set($namespace, $path);
|
||||
}
|
||||
|
||||
$map = require __DIR__ . '/autoload_psr4.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->setPsr4($namespace, $path);
|
||||
}
|
||||
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
$loader->addClassMap($classMap);
|
||||
}
|
||||
}
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
<?php
|
||||
|
||||
// autoload_static.php @generated by Composer
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit82c91dc3983c1c2ce8fc9d4263765de4
|
||||
{
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
'C' =>
|
||||
array (
|
||||
'Curl\\' => 5,
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixDirsPsr4 = array (
|
||||
'Curl\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/php-curl-class/php-curl-class/src/Curl',
|
||||
),
|
||||
);
|
||||
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit82c91dc3983c1c2ce8fc9d4263765de4::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit82c91dc3983c1c2ce8fc9d4263765de4::$prefixDirsPsr4;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
}
|