Skip to content

Commit

Permalink
fix tab to 2space
Browse files Browse the repository at this point in the history
  • Loading branch information
raphealguo committed Apr 27, 2016
1 parent 78de07b commit 26b6e7e
Show file tree
Hide file tree
Showing 7 changed files with 571 additions and 571 deletions.
64 changes: 32 additions & 32 deletions example/demo1.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>vConsole/Demo1</title>
<link href="./lib/weui.min.css" rel="stylesheet"/>
<link href="./lib/demo.css" rel="stylesheet"/>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>vConsole/Demo1</title>
<link href="./lib/weui.min.css" rel="stylesheet"/>
<link href="./lib/demo.css" rel="stylesheet"/>
</head>
<body ontouchstart>
<div class="page">
<h1 class="page_title">Demo 1</h1>
<div class="weui_text_area">
<p class="weui_msg_desc">点击下面的按钮,即可打印 log。<br/>点击右下角按钮,即可查看 log。</p>
</div>
<a href="javascript:;" class="weui_btn weui_btn_primary js_btn_log" data-type="log">普通日志(log)</a>
<a href="javascript:;" class="weui_btn weui_btn_primary js_btn_log" data-type="info">信息日志(info)</a>
<a href="javascript:;" class="weui_btn weui_btn_primary js_btn_log" data-type="debug">调试日志(debug)</a>
<a href="javascript:;" class="weui_btn weui_btn_primary js_btn_log" data-type="warn">警告日志(warn)</a>
<a href="javascript:;" class="weui_btn weui_btn_primary js_btn_log" data-type="error">报错日志(error)</a>
<div class="page">
<h1 class="page_title">Demo 1</h1>
<div class="weui_text_area">
<p class="weui_msg_desc">点击下面的按钮,即可打印 log。<br/>点击右下角按钮,即可查看 log。</p>
</div>
<a href="javascript:;" class="weui_btn weui_btn_primary js_btn_log" data-type="log">普通日志(log)</a>
<a href="javascript:;" class="weui_btn weui_btn_primary js_btn_log" data-type="info">信息日志(info)</a>
<a href="javascript:;" class="weui_btn weui_btn_primary js_btn_log" data-type="debug">调试日志(debug)</a>
<a href="javascript:;" class="weui_btn weui_btn_primary js_btn_log" data-type="warn">警告日志(warn)</a>
<a href="javascript:;" class="weui_btn weui_btn_primary js_btn_log" data-type="error">报错日志(error)</a>

<a href="javascript:;" class="weui_btn weui_btn_default js_btn_log_obj">打印Object</a>
</div>
<div class="weui_toptips weui_notice" id="js_tips">已打印log</div>
<a href="javascript:;" class="weui_btn weui_btn_default js_btn_log_obj">打印Object</a>
</div>
<div class="weui_toptips weui_notice" id="js_tips">已打印log</div>
</body>

<script src="./lib/jquery-1.12.3.min.js"></script>
Expand All @@ -33,30 +33,30 @@ <h1 class="page_title">Demo 1</h1>
<script>
// vConsole完成初始化后将调用ready()的回调函数
vConsole.ready(function() {
console.info('欢迎使用 vConsole。vConsole 是一个由微信公众平台前端团队研发的 Web 前端开发者面板,可用于展示 console 日志,方便开发、调试。');
console.info('欢迎使用 vConsole。vConsole 是一个由微信公众平台前端团队研发的 Web 前端开发者面板,可用于展示 console 日志,方便开发、调试。');
});

$('.js_btn_log').on('click', function(e) {
var type = $(this).data('type');
console[type](type); // 例如,console.log(type)
showTips();
var type = $(this).data('type');
console[type](type); // 例如,console.log(type)
showTips();
});
$('.js_btn_log_obj').on('click', function(e) {
console.log({
'foo': 'bar',
'tips': 'JS对象会转为JSON字符串输出'
});
showTips();
console.log({
'foo': 'bar',
'tips': 'JS对象会转为JSON字符串输出'
});
showTips();
});

// 用于页面内展示顶部tips
var tipsTimer;
function showTips() {
tipsTimer && clearTimeout(tipsTimer);
$('#js_tips').show();
tipsTimer = setTimeout(function() {
$('#js_tips').hide();
}, 1500);
tipsTimer && clearTimeout(tipsTimer);
$('#js_tips').show();
tipsTimer = setTimeout(function() {
$('#js_tips').hide();
}, 1500);
}
</script>
</html>
42 changes: 21 additions & 21 deletions example/demo2.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,45 @@
?><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>vConsole/Demo2</title>
<link href="./lib/weui.min.css" rel="stylesheet"/>
<link href="./lib/demo.css" rel="stylesheet"/>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>vConsole/Demo2</title>
<link href="./lib/weui.min.css" rel="stylesheet"/>
<link href="./lib/demo.css" rel="stylesheet"/>
</head>
<body ontouchstart>
<div class="page">
<h1 class="page_title">Demo 2</h1>
<a href="javascript:;" class="weui_btn weui_btn_primary js_btn_log">Hello World</a>
</div>
<div class="weui_toptips weui_notice" id="js_tips">已打印log</div>
<div class="page">
<h1 class="page_title">Demo 2</h1>
<a href="javascript:;" class="weui_btn weui_btn_primary js_btn_log">Hello World</a>
</div>
<div class="weui_toptips weui_notice" id="js_tips">已打印log</div>
</body>

<script src="./lib/jquery-1.12.3.min.js"></script>
<script src="./lib/fastclick.js"></script>

<?php if ($dev_mode == '1') { ?>
<!-- 引入vConsole的JS库 -->
<script src="../dist/vconsole.min.js"></script>
<!-- 引入vConsole的JS库 -->
<script src="../dist/vconsole.min.js"></script>
<?php } ?>

<script>

$('.js_btn_log').on('click', function(e) {
// 打印log时无须判断是否为dev_mode,
// 未加载vConsole时,console.log()不会显示到前台
console.log('Hello World');
showTips();
// 打印log时无须判断是否为dev_mode,
// 未加载vConsole时,console.log()不会显示到前台
console.log('Hello World');
showTips();
});

// 用于页面内展示顶部tips
var tipsTimer;
function showTips() {
tipsTimer && clearTimeout(tipsTimer);
$('#js_tips').show();
tipsTimer = setTimeout(function() {
$('#js_tips').hide();
}, 1500);
tipsTimer && clearTimeout(tipsTimer);
$('#js_tips').show();
tipsTimer = setTimeout(function() {
$('#js_tips').hide();
}, 1500);
}
</script>
</html>
40 changes: 20 additions & 20 deletions example/lib/demo.css
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
html, body {
height: 100%;
height: 100%;
}
.page {
padding: 25px 15px 0;
height: 100%;
background-color: #fbf9fe;
-webkit-tap-highlight-color: transparent;
padding: 25px 15px 0;
height: 100%;
background-color: #fbf9fe;
-webkit-tap-highlight-color: transparent;
}
.page_title {
color: #225fba;
text-align: center;
font-size: 34px;
font-weight: 400;
margin: 0 15%;
color: #225fba;
text-align: center;
font-size: 34px;
font-weight: 400;
margin: 0 15%;
}

.weui_toptips.weui_notice {
background-color: #FFBE00;
background-color: #FFBE00;
}

.weui_text_area {
margin: 15px 0 25px;
padding: 0 20px;
text-align: center;
margin: 15px 0 25px;
padding: 0 20px;
text-align: center;
}
.weui_msg_desc {
font-size: 14px;
color: #888;
font-size: 14px;
color: #888;
}

.weui_extra_area {
margin-bottom: 15px;
font-size: 14px;
color: #888;
margin-bottom: 15px;
font-size: 14px;
color: #888;
}
.weui_extra_area a {
color: #61749B;
color: #61749B;
}
42 changes: 21 additions & 21 deletions src/tpl.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<!-- vConsole -->
<div id="__vconsole" class="">
<div class="vc-show">面板</div>
<div class="vc-mask">
</div>
<div class="vc-panel">
<div class="vc-tabbar">
<a class="vc-tab vc-actived" data-tab="default" id="__vc_tab_default" href="javascript:;">日志</a>
<a class="vc-tab" data-tab="system" id="__vc_tab_system" href="javascript:;">系统</a>
</div>
<div class="vc-content">
<div class="vc-logbox vc-actived" id="__vc_log_default">
<div class="vc-log"></div>
</div>
<div class="vc-logbox" id="__vc_log_system">
<div class="vc-log"></div>
</div>
</div>
<div class="vc-toolbar">
<a href="javascript:;" class="vc-tool vc-clear">清空</a>
<a href="javascript:;" class="vc-tool vc-tool-last vc-hide">隐藏</a>
</div>
</div>
<div class="vc-show">面板</div>
<div class="vc-mask">
</div>
<div class="vc-panel">
<div class="vc-tabbar">
<a class="vc-tab vc-actived" data-tab="default" id="__vc_tab_default" href="javascript:;">日志</a>
<a class="vc-tab" data-tab="system" id="__vc_tab_system" href="javascript:;">系统</a>
</div>
<div class="vc-content">
<div class="vc-logbox vc-actived" id="__vc_log_default">
<div class="vc-log"></div>
</div>
<div class="vc-logbox" id="__vc_log_system">
<div class="vc-log"></div>
</div>
</div>
<div class="vc-toolbar">
<a href="javascript:;" class="vc-tool vc-clear">清空</a>
<a href="javascript:;" class="vc-tool vc-tool-last vc-hide">隐藏</a>
</div>
</div>
</div>
<!-- /vConsole -->
Loading

0 comments on commit 26b6e7e

Please sign in to comment.