ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject incubator-ponymail git commit: Bug: wordcloud.js logs to the console
Date Thu, 23 Feb 2017 16:58:49 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master ae9abab42 -> 9b1ffd08e


Bug: wordcloud.js logs to the console

This fixes #363

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/9b1ffd08
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/9b1ffd08
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/9b1ffd08

Branch: refs/heads/master
Commit: 9b1ffd08ee44d9078b7e86f6537987f31a86fb45
Parents: ae9abab
Author: Sebb <sebb@apache.org>
Authored: Thu Feb 23 16:58:45 2017 +0000
Committer: Sebb <sebb@apache.org>
Committed: Thu Feb 23 16:58:45 2017 +0000

----------------------------------------------------------------------
 CHANGELOG.md                        | 2 +-
 site/js/dev/ponymail_pagebuilder.js | 2 +-
 site/js/ponymail.js                 | 2 +-
 site/js/wordcloud.js                | 6 ++++--
 4 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/9b1ffd08/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1d14c90..7d25908 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -140,7 +140,7 @@
 - archiver traverses multi-part message parts twice (#359)
 - Add unsubscribe button (#362)
 - Bug: invalid style setting: overflow:hide => overflow:hidden (#364)
-
+- Bug: wordcloud.js logs to the console (#363)
 
 ## CHANGES in 0.9b:
 

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/9b1ffd08/site/js/dev/ponymail_pagebuilder.js
----------------------------------------------------------------------
diff --git a/site/js/dev/ponymail_pagebuilder.js b/site/js/dev/ponymail_pagebuilder.js
index edf1dfd..559e78a 100644
--- a/site/js/dev/ponymail_pagebuilder.js
+++ b/site/js/dev/ponymail_pagebuilder.js
@@ -242,7 +242,7 @@ function buildStats(json, state, show) {
         if (json.cloud) {
             for (var i in json.cloud) {
                 stats.innerHTML += "<h4 style='text-align: center;'>Hot topics:</h4>"
-                stats.appendChild(wordCloud(json.cloud, 250, 80))
+                stats.appendChild(wordCloud(json.cloud, 250, 80, pm_config.debug))
                 break // so..this'll run if cloud has stuff, otherwise not.
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/9b1ffd08/site/js/ponymail.js
----------------------------------------------------------------------
diff --git a/site/js/ponymail.js b/site/js/ponymail.js
index eef5cc0..13232be 100644
--- a/site/js/ponymail.js
+++ b/site/js/ponymail.js
@@ -3848,7 +3848,7 @@ function buildStats(json, state, show) {
         if (json.cloud) {
             for (var i in json.cloud) {
                 stats.innerHTML += "<h4 style='text-align: center;'>Hot topics:</h4>"
-                stats.appendChild(wordCloud(json.cloud, 250, 80))
+                stats.appendChild(wordCloud(json.cloud, 250, 80, pm_config.debug))
                 break // so..this'll run if cloud has stuff, otherwise not.
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/9b1ffd08/site/js/wordcloud.js
----------------------------------------------------------------------
diff --git a/site/js/wordcloud.js b/site/js/wordcloud.js
index 7f4c1d2..c63dd86 100644
--- a/site/js/wordcloud.js
+++ b/site/js/wordcloud.js
@@ -44,7 +44,7 @@ function makeWord(word, size) {
     return txt
 }
 
-function wordCloud(hash, width, height) {
+function wordCloud(hash, width, height, debug) {
     var total = 0
     var boxes = []
     var space = width * height
@@ -63,7 +63,9 @@ function wordCloud(hash, width, height) {
         var word = hashSorted[n]
         var size = 0;
         var expected_area = ( Math.sqrt(hash[word]) / total ) * (space*0.9)
-        console.log(expected_area)
+        if (debug) {
+            console.log(expected_area)
+        }
         
         var txt = document.createElementNS(svgNS, "text");
         txt.textContent = word


Mime
View raw message