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 2017/06/18 07:43:12 UTC
svn commit: r1799054 - in /comdev/reporter.apache.org/trunk/site/js:
coffee/main.coffee tabs.js
Author: humbedooh
Date: Sun Jun 18 07:43:12 2017
New Revision: 1799054
URL: http://svn.apache.org/viewvc?rev=1799054&view=rev
Log:
shorten logic, use match instead of search
Modified:
comdev/reporter.apache.org/trunk/site/js/coffee/main.coffee
comdev/reporter.apache.org/trunk/site/js/tabs.js
Modified: comdev/reporter.apache.org/trunk/site/js/coffee/main.coffee
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/js/coffee/main.coffee?rev=1799054&r1=1799053&r2=1799054&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/js/coffee/main.coffee (original)
+++ comdev/reporter.apache.org/trunk/site/js/coffee/main.coffee Sun Jun 18 07:43:12 2017
@@ -46,10 +46,8 @@ getWednesdays = (mo, y) ->
# check if the entry is a wildcard month
-everyMonth = (s) ->
- if (s.search /next month/i != -1)
- return true
- return s == 'Every month'
+everyMonth = (s) =>
+ s == 'Every month' or s.match(/next month/i)
m = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
Modified: comdev/reporter.apache.org/trunk/site/js/tabs.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/js/tabs.js?rev=1799054&r1=1799053&r2=1799054&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/js/tabs.js (original)
+++ comdev/reporter.apache.org/trunk/site/js/tabs.js Sun Jun 18 07:43:12 2017
@@ -156,12 +156,11 @@ getWednesdays = function(mo, y) {
return wednesdays;
};
-everyMonth = function(s) {
- if (s.search(/next month/i !== -1)) {
- return true;
- }
- return s === 'Every month';
-};
+everyMonth = (function(_this) {
+ return function(s) {
+ return s === 'Every month' || s.match(/next month/i);
+ };
+})(this);
m = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];