Sha256: d6c5744f7ea52ce57ecd82eeac418961b7b7a7fe38fdebc6f0aa9ed29d30059b

Contents?: true

Size: 490 Bytes

Versions: 257

Compression:

Stored size: 490 Bytes

Contents

<script>
  promethee.filter('numberOfWords', function() {
    return function(val) {
      var words = val
        .replace(/\bhttps?:\/\/[a-z0-9\-\._]+(?:\/[^\s\n\r]+)?/gi, 'a') // A URL is one word
        .replace(/\b[a-z0-9\-\._]+@[a-z0-9\-\._]+\.[a-z0-9\-\._]+\b/gi, 'a') // An email is one word
        .replace(/[^a-z0-9\s\n\r]/gi, ' ')
        .replace(/[\s\n\r]+/g, ' ')
        .trim()
        .split(' ');

      return words[0] === '' ? 0 : words.length;
    };
  });
</script>

Version data entries

257 entries across 257 versions & 1 rubygems

Version Path
promethee-5.1.1 app/views/promethee/utils/_number-of-words.html.erb
promethee-5.1.0 app/views/promethee/utils/_number-of-words.html.erb
promethee-5.0.2 app/views/promethee/utils/_number-of-words.html.erb
promethee-5.0.1 app/views/promethee/utils/_number-of-words.html.erb
promethee-5.0.0 app/views/promethee/utils/_number-of-words.html.erb
promethee-4.1.28 app/views/promethee/utils/_number-of-words.html.erb
promethee-4.1.27 app/views/promethee/utils/_number-of-words.html.erb
promethee-4.1.26 app/views/promethee/utils/_number-of-words.html.erb
promethee-4.1.25 app/views/promethee/utils/_number-of-words.html.erb
promethee-4.1.24 app/views/promethee/utils/_number-of-words.html.erb
promethee-4.1.23 app/views/promethee/utils/_number-of-words.html.erb
promethee-4.1.22 app/views/promethee/utils/_number-of-words.html.erb
promethee-4.1.21 app/views/promethee/utils/_number-of-words.html.erb
promethee-4.1.20 app/views/promethee/utils/_number-of-words.html.erb
promethee-4.1.19 app/views/promethee/utils/_number-of-words.html.erb
promethee-4.1.18 app/views/promethee/utils/_number-of-words.html.erb
promethee-4.1.17 app/views/promethee/utils/_number-of-words.html.erb
promethee-4.1.16 app/views/promethee/utils/_number-of-words.html.erb
promethee-4.1.15 app/views/promethee/utils/_number-of-words.html.erb
promethee-4.1.14 app/views/promethee/utils/_number-of-words.html.erb