补充编码头
修复 IE9、IE10 无法正常生成链接的 BUG 其它细节优化
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<p align="center">
|
||||
<a href="http://tool.mkblog.cn/lmbtfy/" target="_blank">
|
||||
<img src="https://user-images.githubusercontent.com/16880885/85223529-75543100-b3f6-11ea-9eb4-6088c1199c74.jpg" alt="让我帮你百度一下">
|
||||
<img src="https://user-images.githubusercontent.com/16880885/85271234-1998af00-b4ad-11ea-8fd9-2c1cabf62ea3.png" alt="让我帮你百度一下">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
-----
|
||||
|
||||
#### 2020/6/21
|
||||
- 重构项目,风格与新版百度 UI 适配。 **注意:本版本修改了参数的获取方式,与旧版不兼容!如果你曾经使用了旧版,那么不要替换为新版,否则以前生成的网址全部会失效**
|
||||
- 重构项目,风格与新版百度 UI 适配。 **注意:本版本修改了参数的获取方式,与旧版不兼容!如果你曾经使用了旧版,那么不要替换为新版,否则以前生成的链接都会失效!**
|
||||
- 移除短网址模块
|
||||
- 增加点击指示特效
|
||||
- 增加“我是自己人”按钮,防止自己人被“带跑”
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@charset "utf-8";
|
||||
|
||||
html, body,
|
||||
div, section, header, footer,
|
||||
button, input, textarea,
|
||||
@@ -114,7 +116,7 @@ html, body {
|
||||
#function {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
top: 40%;
|
||||
min-height: 220px;
|
||||
text-align: center;
|
||||
margin-top: 80px;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta http-equiv="Cache-Control" content="no-transform">
|
||||
@@ -9,6 +10,7 @@
|
||||
|
||||
<title>让我帮你百度一下 | Let Me Baidu That For You</title>
|
||||
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
<link rel="stylesheet" href="css/style.css" />
|
||||
|
||||
<script src="js/jquery.min.js"></script>
|
||||
|
||||
17
js/script.js
17
js/script.js
@@ -2,15 +2,20 @@
|
||||
* 让我帮你百度一下【重制版】
|
||||
* GitHub 开源地址:https://github.com/mengkunsoft/lmbtfy
|
||||
**
|
||||
* 原始版本来自 bangbang(http://lmbtfy.cn/),mengkun(https://mkblog.cn) 在原作的基础上进行了重置,风格变更为新版百度 UI,并适配了移动端
|
||||
* 原始版本来自 bangbang(http://lmbtfy.cn/),mengkun(https://mkblog.cn) 在原作的基础上进行了重制,风格变更为新版百度 UI,并适配了移动端
|
||||
* 交互效果参考了 不会百度么?(http://buhuibaidu.me/)
|
||||
**
|
||||
* 转载或使用时,还请保留以上信息,谢谢!
|
||||
*/
|
||||
|
||||
/* 低版本 IE polyfill */
|
||||
if(!window.location.origin) {
|
||||
window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: '');
|
||||
}
|
||||
|
||||
/* 扩展一个getUrlParam的方法 */
|
||||
$.getUrlParam = function(name){
|
||||
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
|
||||
$.getUrlParam = function(name) {
|
||||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
|
||||
var r = window.location.search.substr(1).match(reg);
|
||||
if (r !== null) return unescape(r[2]); return null;
|
||||
};
|
||||
@@ -35,6 +40,7 @@ $(function() {
|
||||
}
|
||||
}
|
||||
|
||||
/* 有参数,启动百度教程 */
|
||||
if(!!query) {
|
||||
$tips.html('让我来教你正确的打开方式');
|
||||
$stop.fadeIn();
|
||||
@@ -59,7 +65,7 @@ $(function() {
|
||||
clearInterval(typeInterval);
|
||||
$tips.html('3、点击下“百度一下”按钮');
|
||||
|
||||
$arrow.removeClass('active').show().animate({
|
||||
$arrow.removeClass('active').fadeIn().animate({
|
||||
left: $searchSubmit.offset().left + $searchSubmit.width() / 2 + 'px',
|
||||
top: $searchSubmit.offset().top + $searchSubmit.height() / 2 + 'px'
|
||||
}, 1000, function () {
|
||||
@@ -94,11 +100,10 @@ $(function() {
|
||||
|
||||
var question = $.trim($kw.val());
|
||||
if(!question) {
|
||||
$kw.val('');
|
||||
$tips.html('<span style="color: red">搜了个寂寞?</span>');
|
||||
$kw.val('');
|
||||
} else {
|
||||
$tips.html('↓↓↓ 复制下面的链接,教伸手党使用百度');
|
||||
|
||||
$('#output').fadeIn();
|
||||
$urlOutput.val(window.location.origin + window.location.pathname + '?q=' + Base64.encode(question)).focus().select();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user