integ/js/vs/_vs.decay.js
author Anthony Ly <anthonyly.com@gmail.com>
Thu, 18 Apr 2013 11:56:24 +0200
changeset 41 8d64ffdaf5e3
parent 28 84719280c84d
child 53 88666afffe6b
permissions -rwxr-xr-x
résolution problème scrollbar firefox
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     1
(function ($) {
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     2
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     3
$.fn._vs.decay = {
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     4
    tokens:[],
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     5
    update:function(_this) {
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     6
      var incrementationStrate = 1;
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     7
      var top                  = _this.settings.sedimentation.suspension.height
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     8
      var height               = _this.settings.height
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     9
      var intervalStrate       = _this.settings.sedimentation.token.size/4
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    10
      var power                = _this.settings.sedimentation.suspension.decay.power
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    11
      var scale                = _this.settings.options.scale
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    12
      var limit                = _this.settings.sedimentation.token.size.minimum
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    13
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    14
      if(power==null){var power = 0}
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    15
        
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    16
        for(var b = 0; b < this.tokens.length; b++) {
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    17
          var tokenSize  = this.tokens[b].attr("size")
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    18
          if(power!=0){
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    19
            this.tokens[b].attr("size",tokenSize/power)
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    20
          }
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    21
           // Flocculate
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    22
                     
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    23
          if(tokenSize<=limit){
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    24
            if (_this.settings.sedimentation.flocculate.strategy!=null){ 
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    25
              _this.flocculate.destroyIt(_this,this.tokens[b]);
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    26
              _this.strata.update(_this);
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    27
            }
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    28
          }
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    29
        }
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    30
    }
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    31
}
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    32
84719280c84d import VS lib
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    33
})(jQuery);