");
window.frames["iframe_show374"].document.write(decodeHtml($("textarea#stepcodeTextarea374").val()));
window.frames["iframe_show374"].document.close();
$(window.frames["iframe_show374"]).load(function(){
$("#iframe_show374").height($("#iframe_show374").contents().find("body").height()+showittryitheight);
});
$("#iframe_show374").height($("#iframe_show374").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<form action="/study/login.jsp" method="get">
账号:<input type="text" name="name"> <br/>
密码:<input type="password" name="password" > <br/>
<input type="submit" value="登陆">
</form>
<form action="/study/login.jsp" method="get">
账号:<input type="text" name="name"> <br/>
密码:<input type="password" name="password" > <br/>
<input type="submit" value="登陆">
</form>
");
window.frames["iframe374"].document.write(decodeHtml(code374));
window.frames["iframe374"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe374"]).load(function(){
$("#iframe374").height($("#iframe374").contents().find("body").height()+showittryitheight);
});
$("#iframe374").height($("#iframe374").contents().find("body").height()+showittryitheight);
alreadyWriteCode374 = code374;
$("#rendering374").hide();
$("#rendered374").show();
}
var tRereshRetry2DemoPanel374 = setInterval(rereshRetry2DemoPanel374,1000);
var binded374 = false;
$("textarea#stepcodeTextarea374").keyup(function(){
if(!binded374){
$(window).bind('beforeunload',function(){
binded374 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code374 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code374!=newCode){
// window.frames["iframe374"].document.write("
");
// window.frames["iframe374"].document.write(decodeHtml($("textarea#stepcodeTextarea374").val()));
// window.frames["iframe374"].document.close();
// $(window.frames["iframe374"]).load(function(){
// $("#iframe374").height($("#iframe374").contents().find("body").height()+showittryitheight);
// });
// code374 = newCode;
// }
});
$(".tryButton374").click(function(){
$("#tryDiv374").show();
$("#stepcodeTextarea374").focus();
$("#stepcodeTextarea374").height(200);
$("#iframe374").height(0);
window.frames["iframe374"].document.write("
");
window.frames["iframe374"].document.write(decodeHtml($("textarea#stepcodeTextarea374").val()));
window.frames["iframe374"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe374"]).load(function(){
$("#iframe374").height($("#iframe374").contents().find("body").height()+showittryitheight);
});
$("#iframe374").height($("#iframe374").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor374.focus();
editor374.setSize(null, "250");
$("#rendering374").hide();
$("#rendered374").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 editor374 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea374"), {
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);
}
}
});
editor374.on("change",function(doc){
if(!binded374){
$(window).bind('beforeunload',function(){
binded374 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code374 = newCode;
$("textarea#stepcodeTextarea374").val(newCode);
if(alreadyWriteCode374!=code374){
lastModifedTime374 = new Date().getTime();
$("#rendering374").show();
$("#rendered374").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor374 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor374.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv374").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|