MOD avancement dans la Grande Restructuration
[euphorik.git] / js / util.js
index dc404f9..638fa6d 100644 (file)
@@ -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;\r
-         }
-         else if (positionMessage.left < 0) {
+         } else if (positionMessage.left < 0) {
             positionMessage.left = 0;
          }
          
@@ -188,6 +187,8 @@ euphorik.Util.prototype.jsonVersAction = function(json) {
 \r
 /**\r
   * Retourne un hash md5 d'une chaine, dépend de md5.js.\r
+  * @param chaine un string quelconque\r
+  * @return un string hashé\r
   */
 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);\r
-      }
-      else { // set caret
+      } else { // set caret
          this.setCaretToPos(input, selectionStart + replaceString.length);\r
       }
-   }
-   else if (document.selection) {
+   } else if (document.selection) {
       input.focus();
       var range = document.selection.createRange();
       if (range.parentElement() == input) {