allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject [38/50] allura git commit: [#8035] ESLINT FIX: require-jsdoc, valid-jsdoc
Date Wed, 27 Jan 2016 20:22:52 GMT
[#8035] ESLINT FIX: require-jsdoc, valid-jsdoc


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/5fa95485
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/5fa95485
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/5fa95485

Branch: refs/heads/hs/8035
Commit: 5fa95485b19e4178163123e44ff2ae2bc3aba7af
Parents: 085fbb7
Author: Heith Seewald <heiths@gmail.com>
Authored: Thu Jan 21 19:18:12 2016 -0500
Committer: Heith Seewald <heiths@gmail.com>
Committed: Wed Jan 27 15:21:30 2016 -0500

----------------------------------------------------------------------
 .eslintrc                                |  8 +++++++-
 Allura/allura/public/nf/js/navbar.es6.js | 27 ++++++++++++---------------
 2 files changed, 19 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/5fa95485/.eslintrc
----------------------------------------------------------------------
diff --git a/.eslintrc b/.eslintrc
index ff25e9d..835cf29 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -4,7 +4,13 @@
     "indent": [2, 4],
     "jsx-quotes": [0],
     "quotes": [0],
-    "operator-linebreak": [2, "before", { "overrides": { "?": "after", "&&": "after"
} }]
+    "operator-linebreak": [2, "before", { "overrides": { "?": "after", "&&": "after"
} }],
+    "require-jsdoc": [2, {"require": {
+        "FunctionDeclaration": true,
+        "MethodDefinition": false,
+        "ClassDeclaration": false
+    }
+  }]
   },
   "globals": {
     "ReactDOM": true,

http://git-wip-us.apache.org/repos/asf/allura/blob/5fa95485/Allura/allura/public/nf/js/navbar.es6.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/navbar.es6.js b/Allura/allura/public/nf/js/navbar.es6.js
index 2d0201e..d83f1f0 100644
--- a/Allura/allura/public/nf/js/navbar.es6.js
+++ b/Allura/allura/public/nf/js/navbar.es6.js
@@ -21,18 +21,17 @@
 'use strict';
 
 /**
- * Gets the current project url.
-
- * @constructor
- * @param {bool} rest - Return a "rest" version of the url.
- * @returns {string}
- */
-function _getProjectUrl(rest = true) {
+* Gets the current project url.
+* @param {boolean} rest - Return a "rest" version of the url.
+* @returns {string} - Project Url
+*/
+var _getProjectUrl = function(rest = true) {
     var nbhd;
     var proj;
     var nbhd_proj;
-    var ident_classes = document.getElementById('page-body').className.split(' ');
-    for (var cls of ident_classes) {
+    var identClasses = document.getElementById('page-body').className.split(' ');
+    var basePath = rest ? '/rest/' : '/';
+    for (var cls of identClasses) {
         if (cls.indexOf('project-') === 0) {
             proj = cls.slice('project-'.length);
         }
@@ -43,8 +42,8 @@ function _getProjectUrl(rest = true) {
     } else {
         nbhd_proj = `${nbhd}/${proj}`;
     }
-    return (rest ? '/rest/' : '/') + nbhd_proj;
-}
+    return basePath + nbhd_proj;
+};
 
 const ToolsPropType = React.PropTypes.shape({
     mount_point: React.PropTypes.string,
@@ -469,8 +468,8 @@ var Main = React.createClass({
 
     /**
      * Handles the changing of the NavBars grouping threshold.
-
-     * @param {object} event
+     * @param {object} event Fired when the threshold changes
+     * @return {boolean} False
      */
     onUpdateThreshold: function(event) {
         var thres = event.target.value;
@@ -486,8 +485,6 @@ var Main = React.createClass({
 
     /**
      * Handles the sending and updating tool ordinals.
-
-     * @param {array} data - Array of tools
      */
     onToolReorder: function() {
         $('.react-drag.dragging').removeClass('dragging');


Mime
View raw message