From: nicolasconnault Date: Fri, 21 Sep 2007 09:13:02 +0000 (+0000) Subject: MDL-11351 Removed a redundant check for a multiLang JS variable X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=caa0886a9d9ce5805deaff9806b42c976d6391b9;p=moodle.git MDL-11351 Removed a redundant check for a multiLang JS variable --- diff --git a/lib/editor/htmlarea/htmlarea.php b/lib/editor/htmlarea/htmlarea.php index f16df1596c..1631ccc982 100644 --- a/lib/editor/htmlarea/htmlarea.php +++ b/lib/editor/htmlarea/htmlarea.php @@ -225,7 +225,7 @@ HTMLArea.Config = function () { $key = str_replace('_', '-', $key); $strlangarray .= '"'.$key.' ": "'.$key.'_ML",'; } - $strlangarray = substr($strlangarray, 0, -1); + $strlangarray = substr($strlangarray, 0, -1); echo $strlangarray; ?> }; @@ -1943,7 +1943,7 @@ HTMLArea.prototype.setLang = function(lang) { multiLang = true; lang = lang.replace(re, ''); } - + // Remove all lang attributes from span tags in selected html. selectedHTML = selectedHTML.replace(/(]*)lang="[^"]*"([^>]*>)/, "$1$2"); selectedHTML = selectedHTML.replace(/(]*)class="multilang"([^>]*>)/, "$1$2"); @@ -1954,7 +1954,7 @@ HTMLArea.prototype.setLang = function(lang) { var parentEl = this.getParentElement(); var insertNewSpan = false; - + if (parentEl.nodeName == 'SPAN' && parentEl.getAttribute('lang')) { // A language was previously defined for the current block. // Check whether the selected text makes up the whole of the block @@ -1970,7 +1970,7 @@ HTMLArea.prototype.setLang = function(lang) { } } else { parentEl.removeAttribute('lang'); - + var classAttr = parentEl.getAttribute('class'); if (classAttr) { classAttr = classAttr.replace(/multilang/, '').trim(); @@ -1995,9 +1995,7 @@ HTMLArea.prototype.setLang = function(lang) { if (insertNewSpan && lang != '') { var str = '