");
window.frames["iframe_show3323"].document.write(decodeHtml($("textarea#stepcodeTextarea3323").val()));
window.frames["iframe_show3323"].document.close();
$(window.frames["iframe_show3323"]).load(function(){
$("#iframe_show3323").height($("#iframe_show3323").contents().find("body").height()+showittryitheight);
});
$("#iframe_show3323").height($("#iframe_show3323").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
</head>
<style>
body{
font-size: 12px;
font-family: Arial;
}
div.aliPayPageDiv{
text-align: center;
padding-bottom: 40px;
max-width: 1013px;
margin: 10px auto;
}
div.aliPayPageLogo{
margin: 20px;
}
span.confirmMoneyText{
color: #4D4D4D;
}
span.confirmMoney{
display: block;
color: #FF6600;
font-weight: bold;
font-size: 20px;
margin: 10px;
}
button.confirmPay{
background-color: #00AAEE;
border: 1px solid #00AAEE;
text-align: center;
line-height: 31px;
font-size: 14px;
font-weight: 700;
color: white;
width: 107px;
margin-top: 20px;
}
</style>
<div class="aliPayPageDiv">
<div class="aliPayPageLogo">
<img src="http://127.0.0.1/tmall../../../img/site/simpleLogo.png" class="pull-left">
<div style="clear:both"></div>
</div>
<div>
<span class="confirmMoneyText">扫一扫付款(元)</span>
<span class="confirmMoney">
¥1,359.20</span>
</div>
<div>
<img src="http://127.0.0.1/tmall../../../img/site/alipay2wei.png" class="aliPayImg">
</div>
<div>
<a href="#nowhere"><button class="confirmPay">确认支付</button></a>
</div>
</div>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://127.0.0.1/study../../../js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://127.0.0.1/study../../../css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="http://127.0.0.1/study../../../js/bootstrap/3.3.6/bootstrap.min.js"></script>
</head>
<style>
body{
font-size: 12px;
font-family: Arial;
}
div.aliPayPageDiv{
text-align: center;
padding-bottom: 40px;
max-width: 1013px;
margin: 10px auto;
}
div.aliPayPageLogo{
margin: 20px;
}
span.confirmMoneyText{
color: #4D4D4D;
}
span.confirmMoney{
display: block;
color: #FF6600;
font-weight: bold;
font-size: 20px;
margin: 10px;
}
button.confirmPay{
background-color: #00AAEE;
border: 1px solid #00AAEE;
text-align: center;
line-height: 31px;
font-size: 14px;
font-weight: 700;
color: white;
width: 107px;
margin-top: 20px;
}
</style>
<div class="aliPayPageDiv">
<div class="aliPayPageLogo">
<img src="http://127.0.0.1/tmall../../../img/site/simpleLogo.png" class="pull-left">
<div style="clear:both"></div>
</div>
<div>
<span class="confirmMoneyText">扫一扫付款(元)</span>
<span class="confirmMoney">
¥1,359.20</span>
</div>
<div>
<img src="http://127.0.0.1/tmall../../../img/site/alipay2wei.png" class="aliPayImg">
</div>
<div>
<a href="#nowhere"><button class="confirmPay">确认支付</button></a>
</div>
</div>
");
window.frames["iframe3323"].document.write(decodeHtml(code3323));
window.frames["iframe3323"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3323"]).load(function(){
$("#iframe3323").height($("#iframe3323").contents().find("body").height()+showittryitheight);
});
$("#iframe3323").height($("#iframe3323").contents().find("body").height()+showittryitheight);
alreadyWriteCode3323 = code3323;
$("#rendering3323").hide();
$("#rendered3323").show();
}
var tRereshRetry2DemoPanel3323 = setInterval(rereshRetry2DemoPanel3323,1000);
var binded3323 = false;
$("textarea#stepcodeTextarea3323").keyup(function(){
if(!binded3323){
$(window).bind('beforeunload',function(){
binded3323 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code3323 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code3323!=newCode){
// window.frames["iframe3323"].document.write("
");
// window.frames["iframe3323"].document.write(decodeHtml($("textarea#stepcodeTextarea3323").val()));
// window.frames["iframe3323"].document.close();
// $(window.frames["iframe3323"]).load(function(){
// $("#iframe3323").height($("#iframe3323").contents().find("body").height()+showittryitheight);
// });
// code3323 = newCode;
// }
});
$(".tryButton3323").click(function(){
$("#tryDiv3323").show();
$("#stepcodeTextarea3323").focus();
$("#stepcodeTextarea3323").height(200);
$("#iframe3323").height(0);
window.frames["iframe3323"].document.write("
");
window.frames["iframe3323"].document.write(decodeHtml($("textarea#stepcodeTextarea3323").val()));
window.frames["iframe3323"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3323"]).load(function(){
$("#iframe3323").height($("#iframe3323").contents().find("body").height()+showittryitheight);
});
$("#iframe3323").height($("#iframe3323").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor3323.focus();
editor3323.setSize(null, "250");
$("#rendering3323").hide();
$("#rendered3323").hide();
});
var mixedMode = {
name: "htmlmixed",
scriptTypes: [{matches: /\/x-handlebars-template|\/x-mustache/i,
mode: null},
{matches: /(text|application)\/(x-)?vb(a|script)/i,
mode: "vbscript"}]
};
var editor3323 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea3323"), {
lineNumbers: true,
styleActiveLine: true,
matchBrackets: true,
mode:"text/html",
theme:"eclipse",
selectionPointer: true,
lineWrapping: true,
extraKeys: {
"Alt-/": "autocomplete",
"Ctrl-F": "findPersistent",
"F8": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}
}
});
editor3323.on("change",function(doc){
if(!binded3323){
$(window).bind('beforeunload',function(){
binded3323 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code3323 = newCode;
$("textarea#stepcodeTextarea3323").val(newCode);
if(alreadyWriteCode3323!=code3323){
lastModifedTime3323 = new Date().getTime();
$("#rendering3323").show();
$("#rendered3323").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor3323 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor3323.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv3323").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|