ep_stats 0.0.50 → 0.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -38,4 +38,5 @@ exports.eejsBlock_mySettings = (hookName, args, cb) => {
38
38
  exports.eejsBlock_dd_view = (hookName, args, cb) => {
39
39
  args.content +=
40
40
  "<li><a href='#' onClick='$(\"#options-stats\").click();'>Pad Statistics</a></li>";
41
+ return cb();
41
42
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ep_stats",
3
3
  "description": "See pad Stats in Etherpad",
4
- "version": "0.0.50",
4
+ "version": "0.0.51",
5
5
  "author": {
6
6
  "name": "John McLear",
7
7
  "email": "john@mclear.co.uk",
@@ -164,6 +164,7 @@ stats.authors = {
164
164
  if (spanClass.indexOf('author') !== -1) { // if an author class exists on this span
165
165
  results[spanClass] = number;
166
166
  } else {
167
+ if (!results[spanClass]) results[spanClass] = 0;
167
168
  results[spanClass] += 1;
168
169
  }
169
170
  });
@@ -183,7 +184,7 @@ stats.authors = {
183
184
  classes = classes.split(' ');
184
185
  const number = $(this).text().replace(/\s/g, '').length; // get length without whitespace
185
186
  $.each(classes, (k, spanClass) => {
186
- if (classes.indexOf('author') !== -1) { // if an author class exists on this span
187
+ if (spanClass.indexOf('author') !== -1) { // if an author class exists on this span
187
188
  results[spanClass] = number;
188
189
  } else {
189
190
  results[spanClass] += number;