");
window.frames["iframe_show3372"].document.write(decodeHtml($("textarea#stepcodeTextarea3372").val()));
window.frames["iframe_show3372"].document.close();
$(window.frames["iframe_show3372"]).load(function(){
$("#iframe_show3372").height($("#iframe_show3372").contents().find("body").height()+showittryitheight);
});
$("#iframe_show3372").height($("#iframe_show3372").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>
div.registerDiv{
margin: 10px 20px;
text-align: center;
}
table.registerTable{
color: #3C3C3C;
font-size: 16px;
table-layout: fixed;
margin-top: 50px;
}
table.registerTable td{
padding: 10px 30px;
}
table.registerTable input{
border: 1px solid #DEDEDE;
width: 213px;
height: 36px;
font-size: 14px;
}
table.registerTable button{
width: 170px;
height: 36px;
border-radius: 2px;
color: white;
background-color: #C40000;
border-width: 0px;
}
td.registerTip{
font-weight: bold;
}
td.registerTableLeftTD{
width: 300px;
text-align: right;
}
td.registerTableRightTD{
width: 300px;
text-align: left;
}
td.registerButtonTD{
text-align: center;
}
</style>
<div class="registerDiv">
<table align="center" class="registerTable">
<tbody><tr>
<td class="registerTip registerTableLeftTD">设置会员名</td>
<td></td>
</tr>
<tr>
<td class="registerTableLeftTD">登陆名</td>
<td class="registerTableRightTD"><input placeholder="会员名一旦设置成功,无法修改" name="name" id="name"> </td>
</tr>
<tr>
<td class="registerTip registerTableLeftTD">设置登陆密码</td>
<td class="registerTableRightTD">登陆时验证,保护账号信息</td>
</tr>
<tr>
<td class="registerTableLeftTD">登陆密码</td>
<td class="registerTableRightTD"><input type="password" placeholder="设置你的登陆密码" name="password" id="password"> </td>
</tr>
<tr>
<td class="registerTableLeftTD">密码确认</td>
<td class="registerTableRightTD"><input type="password" placeholder="请再次输入你的密码" id="repeatpassword"> </td>
</tr>
<tr>
<td class="registerButtonTD" colspan="2">
<a href="#nowhere"><button>提 交</button></a>
</td>
</tr>
</tbody></table>
</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>
div.registerDiv{
margin: 10px 20px;
text-align: center;
}
table.registerTable{
color: #3C3C3C;
font-size: 16px;
table-layout: fixed;
margin-top: 50px;
}
table.registerTable td{
padding: 10px 30px;
}
table.registerTable input{
border: 1px solid #DEDEDE;
width: 213px;
height: 36px;
font-size: 14px;
}
table.registerTable button{
width: 170px;
height: 36px;
border-radius: 2px;
color: white;
background-color: #C40000;
border-width: 0px;
}
td.registerTip{
font-weight: bold;
}
td.registerTableLeftTD{
width: 300px;
text-align: right;
}
td.registerTableRightTD{
width: 300px;
text-align: left;
}
td.registerButtonTD{
text-align: center;
}
</style>
<div class="registerDiv">
<table align="center" class="registerTable">
<tbody><tr>
<td class="registerTip registerTableLeftTD">设置会员名</td>
<td></td>
</tr>
<tr>
<td class="registerTableLeftTD">登陆名</td>
<td class="registerTableRightTD"><input placeholder="会员名一旦设置成功,无法修改" name="name" id="name"> </td>
</tr>
<tr>
<td class="registerTip registerTableLeftTD">设置登陆密码</td>
<td class="registerTableRightTD">登陆时验证,保护账号信息</td>
</tr>
<tr>
<td class="registerTableLeftTD">登陆密码</td>
<td class="registerTableRightTD"><input type="password" placeholder="设置你的登陆密码" name="password" id="password"> </td>
</tr>
<tr>
<td class="registerTableLeftTD">密码确认</td>
<td class="registerTableRightTD"><input type="password" placeholder="请再次输入你的密码" id="repeatpassword"> </td>
</tr>
<tr>
<td class="registerButtonTD" colspan="2">
<a href="#nowhere"><button>提 交</button></a>
</td>
</tr>
</tbody></table>
</div>
");
window.frames["iframe3372"].document.write(decodeHtml(code3372));
window.frames["iframe3372"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3372"]).load(function(){
$("#iframe3372").height($("#iframe3372").contents().find("body").height()+showittryitheight);
});
$("#iframe3372").height($("#iframe3372").contents().find("body").height()+showittryitheight);
alreadyWriteCode3372 = code3372;
$("#rendering3372").hide();
$("#rendered3372").show();
}
var tRereshRetry2DemoPanel3372 = setInterval(rereshRetry2DemoPanel3372,1000);
var binded3372 = false;
$("textarea#stepcodeTextarea3372").keyup(function(){
if(!binded3372){
$(window).bind('beforeunload',function(){
binded3372 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code3372 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code3372!=newCode){
// window.frames["iframe3372"].document.write("
");
// window.frames["iframe3372"].document.write(decodeHtml($("textarea#stepcodeTextarea3372").val()));
// window.frames["iframe3372"].document.close();
// $(window.frames["iframe3372"]).load(function(){
// $("#iframe3372").height($("#iframe3372").contents().find("body").height()+showittryitheight);
// });
// code3372 = newCode;
// }
});
$(".tryButton3372").click(function(){
$("#tryDiv3372").show();
$("#stepcodeTextarea3372").focus();
$("#stepcodeTextarea3372").height(200);
$("#iframe3372").height(0);
window.frames["iframe3372"].document.write("
");
window.frames["iframe3372"].document.write(decodeHtml($("textarea#stepcodeTextarea3372").val()));
window.frames["iframe3372"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe3372"]).load(function(){
$("#iframe3372").height($("#iframe3372").contents().find("body").height()+showittryitheight);
});
$("#iframe3372").height($("#iframe3372").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor3372.focus();
editor3372.setSize(null, "250");
$("#rendering3372").hide();
$("#rendered3372").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 editor3372 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea3372"), {
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);
}
}
});
editor3372.on("change",function(doc){
if(!binded3372){
$(window).bind('beforeunload',function(){
binded3372 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code3372 = newCode;
$("textarea#stepcodeTextarea3372").val(newCode);
if(alreadyWriteCode3372!=code3372){
lastModifedTime3372 = new Date().getTime();
$("#rendering3372").show();
$("#rendered3372").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor3372 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor3372.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv3372").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
|
渲染中
渲染完成
|