fhem_codemirror.js: remove the jquery loading (Forum #33226)

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@7853 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2015-02-03 19:14:44 +00:00
parent 9cbdc33e9d
commit 8fabefe460

View File

@@ -1,24 +1,22 @@
var cm_loaded = 0, cm_editor;
loadScript("pgm2/jquery.min.js", function(){
$(document).ready(function(){
var els = document.getElementsByTagName("textarea");
if(els.length == 0)
return;
$(document).ready(function(){
var els = document.getElementsByTagName("textarea");
if(els.length == 0)
return;
if($(els[0]).closest("div#edit").css("display")=="none") { // DEF special
$("table.internals a").each(function(){
var oc = $(this).attr("onclick");
if(oc) {
$(this).attr("onclick", oc+
's=document.getElementById("edit").getElementsByTagName("textarea");'+
'if(!s[0].editor) s[0].editor=AddCodeMirror(s[0]);');
}
});
} else {
AddCodeMirror(els[0]);
}
});
if($(els[0]).closest("div#edit").css("display")=="none") { // DEF special
$("table.internals a").each(function(){
var oc = $(this).attr("onclick");
if(oc) {
$(this).attr("onclick", oc+
's=document.getElementById("edit").getElementsByTagName("textarea");'+
'if(!s[0].editor) s[0].editor=AddCodeMirror(s[0]);');
}
});
} else {
AddCodeMirror(els[0]);
}
});
function