补充编码头

修复 IE9、IE10 无法正常生成链接的 BUG
其它细节优化
This commit is contained in:
mengkunsoft
2020-06-22 18:51:13 +08:00
parent f64cbc9813
commit 3ea29f66bf
4 changed files with 19 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
<p align="center"> <p align="center">
<a href="http://tool.mkblog.cn/lmbtfy/" target="_blank"> <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> </a>
</p> </p>
@@ -43,7 +43,7 @@
----- -----
#### 2020/6/21 #### 2020/6/21
- 重构项目,风格与新版百度 UI 适配。 **注意:本版本修改了参数的获取方式,与旧版不兼容!如果你曾经使用了旧版,那么不要替换为新版,否则以前生成的网址全部会失效** - 重构项目,风格与新版百度 UI 适配。 **注意:本版本修改了参数的获取方式,与旧版不兼容!如果你曾经使用了旧版,那么不要替换为新版,否则以前生成的链接都会失效**
- 移除短网址模块 - 移除短网址模块
- 增加点击指示特效 - 增加点击指示特效
- 增加“我是自己人”按钮,防止自己人被“带跑” - 增加“我是自己人”按钮,防止自己人被“带跑”

View File

@@ -1,3 +1,5 @@
@charset "utf-8";
html, body, html, body,
div, section, header, footer, div, section, header, footer,
button, input, textarea, button, input, textarea,
@@ -114,7 +116,7 @@ html, body {
#function { #function {
position: absolute; position: absolute;
width: 100%; width: 100%;
top: 40%; min-height: 220px;
text-align: center; text-align: center;
margin-top: 80px; margin-top: 80px;
} }

View File

@@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta charset="utf-8">
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Cache-Control" content="no-transform"> <meta http-equiv="Cache-Control" content="no-transform">
@@ -9,6 +10,7 @@
<title>让我帮你百度一下 | Let Me Baidu That For You</title> <title>让我帮你百度一下 | Let Me Baidu That For You</title>
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/style.css" />
<script src="js/jquery.min.js"></script> <script src="js/jquery.min.js"></script>
@@ -63,4 +65,4 @@
<div id="arrow"></div> <div id="arrow"></div>
</body> </body>
</html> </html>

View File

@@ -2,15 +2,20 @@
* 让我帮你百度一下【重制版】 * 让我帮你百度一下【重制版】
* GitHub 开源地址https://github.com/mengkunsoft/lmbtfy * 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/) * 交互效果参考了 不会百度么?(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的方法 */
$.getUrlParam = function(name){ $.getUrlParam = function(name) {
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg); var r = window.location.search.substr(1).match(reg);
if (r !== null) return unescape(r[2]); return null; if (r !== null) return unescape(r[2]); return null;
}; };
@@ -35,6 +40,7 @@ $(function() {
} }
} }
/* 有参数,启动百度教程 */
if(!!query) { if(!!query) {
$tips.html('让我来教你正确的打开方式'); $tips.html('让我来教你正确的打开方式');
$stop.fadeIn(); $stop.fadeIn();
@@ -59,7 +65,7 @@ $(function() {
clearInterval(typeInterval); clearInterval(typeInterval);
$tips.html('3、点击下“百度一下”按钮'); $tips.html('3、点击下“百度一下”按钮');
$arrow.removeClass('active').show().animate({ $arrow.removeClass('active').fadeIn().animate({
left: $searchSubmit.offset().left + $searchSubmit.width() / 2 + 'px', left: $searchSubmit.offset().left + $searchSubmit.width() / 2 + 'px',
top: $searchSubmit.offset().top + $searchSubmit.height() / 2 + 'px' top: $searchSubmit.offset().top + $searchSubmit.height() / 2 + 'px'
}, 1000, function () { }, 1000, function () {
@@ -94,11 +100,10 @@ $(function() {
var question = $.trim($kw.val()); var question = $.trim($kw.val());
if(!question) { if(!question) {
$kw.val('');
$tips.html('<span style="color: red">搜了个寂寞?</span>'); $tips.html('<span style="color: red">搜了个寂寞?</span>');
$kw.val('');
} else { } else {
$tips.html('↓↓↓ 复制下面的链接,教伸手党使用百度'); $tips.html('↓↓↓ 复制下面的链接,教伸手党使用百度');
$('#output').fadeIn(); $('#output').fadeIn();
$urlOutput.val(window.location.origin + window.location.pathname + '?q=' + Base64.encode(question)).focus().select(); $urlOutput.val(window.location.origin + window.location.pathname + '?q=' + Base64.encode(question)).focus().select();
} }