7 IriSP.TagCloudWidget.prototype.draw = function() { |
7 IriSP.TagCloudWidget.prototype.draw = function() { |
8 |
8 |
9 var _stopwords = [ |
9 var _stopwords = [ |
10 'aussi', 'and', 'avec', 'aux', 'car', 'cette', 'comme', 'dans', 'donc', 'des', 'elle', 'est', |
10 'aussi', 'and', 'avec', 'aux', 'car', 'cette', 'comme', 'dans', 'donc', 'des', 'elle', 'est', |
11 'être', 'eux', 'fait', 'ici', 'ils', 'les', 'leur', 'leurs', 'mais', 'mes', 'même', 'mon', 'notre', |
11 'être', 'eux', 'fait', 'ici', 'ils', 'les', 'leur', 'leurs', 'mais', 'mes', 'même', 'mon', 'notre', |
12 'nos', 'nous', 'ont', 'par', 'pas', 'peu', 'pour', 'que', 'qui', 'ses' ,'son', 'sont', 'sur', |
12 'non', 'nos', 'nous', 'ont', 'par', 'pas', 'peu', 'pour', 'que', 'qui', 'ses' ,'son', 'sont', 'sur', |
13 'tes', 'très', 'the', 'ton', 'tous', 'tout', 'une', 'votre', 'vos', 'vous' |
13 'tes', 'très', 'the', 'ton', 'tous', 'tout', 'une', 'votre', 'vos', 'vous' |
14 ], |
14 ], |
15 _regexpword = /[^\s\.&;,'"!\?\d\(\)\+\[\]\\\…\-«»:\/]{3,}/g, |
15 _regexpword = /[^\s\.&;,'"!\?\d\(\)\+\[\]\\\…\-«»:\/]{3,}/g, |
16 _words = {}, |
16 _words = {}, |
17 _showTitle = !this._config.excludeTitle, |
17 _showTitle = !this._config.excludeTitle, |
64 .join("") |
65 .join("") |
65 + '</ul>'; |
66 + '</ul>'; |
66 this.selector |
67 this.selector |
67 .addClass("Ldt-TagCloud") |
68 .addClass("Ldt-TagCloud") |
68 .html(_html); |
69 .html(_html); |
69 |
70 this.selector.find("li").click(function() { |
|
71 var _txt = this.textContent.replace(/(^[\s]+|[\s]+$)/g,''); |
|
72 _this._Popcorn.trigger("IriSP.search", _txt); |
|
73 }); |
|
74 this._Popcorn.listen("IriSP.search", IriSP.wrap(this, function(searchString) { |
|
75 var _rgxp = new RegExp("(" + searchString.replace(/(\W)/g,'\\$1') + ")","gi"); |
|
76 this.selector.find("li").each(function(_i, _e) { |
|
77 _e.innerHTML = searchString.length ? |
|
78 _e.textContent.replace(_rgxp,'<span class="Ldt-TagCloud-actif">$1</span>') |
|
79 : _e.textContent; |
|
80 }); |
|
81 })); |
|
82 this._Popcorn.listen("IriSP.search.closed", IriSP.wrap(this, this.searchFieldClosedHandler)); |
|
83 this._Popcorn.listen("IriSP.search.cleared", IriSP.wrap(this, this.searchFieldClearedHandler)); |
70 } |
84 } |
|
85 |
|
86 IriSP.TagCloudWidget.prototype.endsearch = function() { |
|
87 this.selector.find("li").each(function(_i, _e) { |
|
88 _e.innerHTML = _e.textContent; |
|
89 }); |
|
90 } |