X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2Futil.js;h=638fa6d9dcefcfee18964664fd3c9ea6e0290e05;hp=dc404f966061d5e86b03c9393823fa6b701a7e27;hb=7fb422d6d4a7a59c8f74d938371a4a10474e8ea4;hpb=ce1fba00ff3eaa6708d6070763f74a400273203b diff --git a/js/util.js b/js/util.js index dc404f9..638fa6d 100644 --- a/js/util.js +++ b/js/util.js @@ -26,7 +26,7 @@ * @formateur permet de formater les messages affichés à l'aide de messageDialogue (facultatif), voir "formateur.js". */ euphorik.Util = function (formateur) { - $("#info .fermer").click(function(){ + $("#info .fermer").click(function() { $("#info").slideUp(50); }); @@ -167,8 +167,7 @@ euphorik.Util.prototype.infoBulle = function(message, element, position) { var depassementDroit = (positionMessage.left + m.width()) - $("body").width(); if (depassementDroit > 0) { positionMessage.left -= depassementDroit; - } - else if (positionMessage.left < 0) { + } else if (positionMessage.left < 0) { positionMessage.left = 0; } @@ -188,6 +187,8 @@ euphorik.Util.prototype.jsonVersAction = function(json) { /** * Retourne un hash md5 d'une chaine, dépend de md5.js. + * @param chaine un string quelconque + * @return un string hashé */ euphorik.Util.prototype.md5 = function(chaine) { return hex_md5(chaine); @@ -198,8 +199,7 @@ euphorik.Util.prototype.setSelectionRange = function(input, selectionStart, sele if (input.setSelectionRange) { input.focus(); input.setSelectionRange(selectionStart, selectionEnd); - } - else if (input.createTextRange) { + } else if (input.createTextRange) { var range = input.createTextRange(); range.collapse(true); range.moveEnd('character', selectionEnd); @@ -231,12 +231,10 @@ euphorik.Util.prototype.replaceSelection = function(input, replaceString) { if (selectionStart != selectionEnd) { // has there been a selection this.setSelectionRange(input, selectionStart, selectionStart + replaceString.length); - } - else { // set caret + } else { // set caret this.setCaretToPos(input, selectionStart + replaceString.length); } - } - else if (document.selection) { + } else if (document.selection) { input.focus(); var range = document.selection.createRange(); if (range.parentElement() == input) {