You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by hu...@apache.org on 2019/10/05 15:05:03 UTC
svn commit: r1868026 - in /comdev/reporter.apache.org/trunk/site/wizard/js:
source/generators.js wizard-beta.js
Author: humbedooh
Date: Sat Oct 5 15:05:03 2019
New Revision: 1868026
URL: http://svn.apache.org/viewvc?rev=1868026&view=rev
Log:
test for undefined txt
Modified:
comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js
comdev/reporter.apache.org/trunk/site/wizard/js/wizard-beta.js
Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js?rev=1868026&r1=1868025&r2=1868026&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js Sat Oct 5 15:05:03 2019
@@ -516,6 +516,7 @@ function activity_tips(data) {
// Quick check for reflow needs
function should_reflow(txt, chars) {
+ if (typeof txt != 'string') return false;
chars = chars || 80;
let lines = txt.split(/[\r\n]+/g);
for (var i = 0; i < lines.length; i++) {
@@ -525,6 +526,7 @@ function should_reflow(txt, chars) {
}
function reflow(txt, chars) {
+ if (typeof txt != 'string') return "";
chars = chars || 80;
let words = txt.match(/([\S+?]+\s*)/mg);
if (!words) return txt;
@@ -564,4 +566,4 @@ function show_examples(examples, title)
}
title = "Examples for %s:".format(title);
modal(out, title);
-}
\ No newline at end of file
+}
Modified: comdev/reporter.apache.org/trunk/site/wizard/js/wizard-beta.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/wizard-beta.js?rev=1868026&r1=1868025&r2=1868026&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/wizard-beta.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/wizard-beta.js Sat Oct 5 15:05:03 2019
@@ -1731,6 +1731,7 @@ function activity_tips(data) {
// Quick check for reflow needs
function should_reflow(txt, chars) {
+ if (typeof txt != 'string') return false;
chars = chars || 80;
let lines = txt.split(/[\r\n]+/g);
for (var i = 0; i < lines.length; i++) {
@@ -1740,6 +1741,7 @@ function should_reflow(txt, chars) {
}
function reflow(txt, chars) {
+ if (typeof txt != 'string') return "";
chars = chars || 80;
let words = txt.match(/([\S+?]+\s*)/mg);
if (!words) return txt;
@@ -1781,6 +1783,7 @@ function show_examples(examples, title)
modal(out, title);
}
+
/******************************************
Fetched from source/init.js
******************************************/