");
window.frames["iframe_show357"].document.write(decodeHtml($("textarea#stepcodeTextarea357").val()));
window.frames["iframe_show357"].document.close();
$(window.frames["iframe_show357"]).load(function(){
$("#iframe_show357").height($("#iframe_show357").contents().find("body").height()+showittryitheight);
});
$("#iframe_show357").height($("#iframe_show357").contents().find("body").height()+showittryitheight);
setTimeout(function(){
},500);
});
<input type="password">
");
window.frames["iframe357"].document.write(decodeHtml(code357));
window.frames["iframe357"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe357"]).load(function(){
$("#iframe357").height($("#iframe357").contents().find("body").height()+showittryitheight);
});
$("#iframe357").height($("#iframe357").contents().find("body").height()+showittryitheight);
alreadyWriteCode357 = code357;
$("#rendering357").hide();
$("#rendered357").show();
}
var tRereshRetry2DemoPanel357 = setInterval(rereshRetry2DemoPanel357,1000);
var binded357 = false;
$("textarea#stepcodeTextarea357").keyup(function(){
if(!binded357){
$(window).bind('beforeunload',function(){
binded357 = true;
return "xxxx";
});
}
var newCode = $(this).val()
code357 = newCode;
/*below code is replaced by function rereshRetry2DemoPanel()*/
// if(code357!=newCode){
// window.frames["iframe357"].document.write("
");
// window.frames["iframe357"].document.write(decodeHtml($("textarea#stepcodeTextarea357").val()));
// window.frames["iframe357"].document.close();
// $(window.frames["iframe357"]).load(function(){
// $("#iframe357").height($("#iframe357").contents().find("body").height()+showittryitheight);
// });
// code357 = newCode;
// }
});
$(".tryButton357").click(function(){
$("#tryDiv357").show();
$("#stepcodeTextarea357").focus();
$("#stepcodeTextarea357").height(200);
$("#iframe357").height(0);
window.frames["iframe357"].document.write("
");
window.frames["iframe357"].document.write(decodeHtml($("textarea#stepcodeTextarea357").val()));
window.frames["iframe357"].document.close();
//load和下面的非load必需并存,因为如果代码用到了jquery就必须使用load的方式
$(window.frames["iframe357"]).load(function(){
$("#iframe357").height($("#iframe357").contents().find("body").height()+showittryitheight);
});
$("#iframe357").height($("#iframe357").contents().find("body").height()+showittryitheight);
this.scrollIntoView(true);
editor357.focus();
editor357.setSize(null, "250");
$("#rendering357").hide();
$("#rendered357").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 editor357 = CodeMirror.fromTextArea(document.getElementById("stepcodeTextarea357"), {
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);
}
}
});
editor357.on("change",function(doc){
if(!binded357){
$(window).bind('beforeunload',function(){
binded357 = true;
return "xxxx";
});
}
var newCode = doc.getValue();
code357 = newCode;
$("textarea#stepcodeTextarea357").val(newCode);
if(alreadyWriteCode357!=code357){
lastModifedTime357 = new Date().getTime();
$("#rendering357").show();
$("#rendered357").hide();
}
// alert(doc.getValue());
});
$(".CodeMirror").addClass("form-control");
// var editor357 = CodeMirror.fromTextArea(, {
// lineNumbers: true,
// styleActiveLine: true,
// matchBrackets: true,
// theme:"eclipse",
// });
editor357.on("change",function(doc){
// alert(doc.getValue());
});
$("#tryDiv357").hide();
});
$("div.codemirrorTips span").addClass("glyphicon glyphicon-asterisk");
1. 双击选中单词
2. 三击选中整行
3. CTRL+F 查找
4. F8 全屏编辑,再次点击恢复
|
渲染中
渲染完成
|