changeset 8257:d6efaa91e967

eslint: fix "is defined but never used"
author Mads Kiilerich <mads@kiilerich.com>
date Fri, 10 Jan 2020 00:34:22 +0100
parents 293cba6cec72
children fd92fe65a2ab
files kallithea/public/js/base.js kallithea/public/js/graph.js kallithea/templates/admin/auth/auth_settings.html kallithea/templates/admin/gists/edit.html kallithea/templates/admin/gists/new.html kallithea/templates/admin/repos/repo_creating.html kallithea/templates/admin/settings/settings_hooks.html kallithea/templates/admin/settings/settings_vcs.html kallithea/templates/base/base.html kallithea/templates/base/perms_summary.html kallithea/templates/changelog/changelog.html kallithea/templates/changelog/changelog_table.html kallithea/templates/changeset/changeset.html kallithea/templates/changeset/diff_block.html kallithea/templates/compare/compare_cs.html kallithea/templates/compare/compare_diff.html kallithea/templates/files/files_add.html kallithea/templates/index_base.html kallithea/templates/pullrequests/pullrequest.html kallithea/templates/pullrequests/pullrequest_show.html kallithea/templates/summary/statistics.html kallithea/templates/summary/summary.html
diffstat 22 files changed, 53 insertions(+), 56 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/public/js/base.js	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/public/js/base.js	Fri Jan 10 00:34:22 2020 +0100
@@ -386,7 +386,7 @@
                     success();
                 }
             })
-        .fail(function(jqXHR, textStatus, errorThrown) {
+        .fail(function(jqXHR, textStatus) {
                 if (textStatus == "abort")
                     return;
                 $target.html('<span class="bg-danger">ERROR: {0}</span>'.format(textStatus));
@@ -397,7 +397,7 @@
 
 function ajaxGET(url, success, failure) {
     if(failure === undefined) {
-        failure = function(jqXHR, textStatus, errorThrown) {
+        failure = function(jqXHR, textStatus) {
                 if (textStatus != "abort")
                     alert("Ajax GET error: " + textStatus);
             };
@@ -411,7 +411,7 @@
     postData['_session_csrf_secret_token'] = _session_csrf_secret_token;
     var postData = _toQueryString(postData);
     if(failure === undefined) {
-        failure = function(jqXHR, textStatus, errorThrown) {
+        failure = function(jqXHR, textStatus) {
                 if (textStatus != "abort")
                     alert("Error posting to server: " + textStatus);
             };
@@ -461,7 +461,7 @@
         'follows_repository_id': follows_repository_id,
         '_session_csrf_secret_token': _session_csrf_secret_token
     }
-    $.post(TOGGLE_FOLLOW_URL, args, function(data){
+    $.post(TOGGLE_FOLLOW_URL, args, function(){
             _onSuccessFollow(target);
         });
     return false;
@@ -555,7 +555,7 @@
         var $q_filter_field = $('#' + target);
         var F = namespace(target);
 
-        $q_filter_field.keyup(function (e) {
+        $q_filter_field.keyup(function () {
             clearTimeout(F.filterTimeout);
             F.filterTimeout = setTimeout(F.updateFilter, 600);
         });
@@ -663,7 +663,7 @@
     var addlabel = TRANSLATION_MAP['Add Another Comment'];
     var $add = $('<div class="add-button-row"><span class="btn btn-default btn-xs add-button">{0}</span></div>'.format(addlabel));
     $comment_div.append($add);
-    $add.children('.add-button').click(function(e) {
+    $add.children('.add-button').click(function() {
         comment_div_state($comment_div, f_path, line_no, true);
     });
 }
@@ -771,7 +771,7 @@
     });
 
     // add event handler for hide/cancel buttons
-    $form.find('.hide-inline-form').click(function(e) {
+    $form.find('.hide-inline-form').click(function() {
         comment_div_state($comment_div, f_path, line_no);
     });
 
@@ -788,7 +788,7 @@
 function deleteComment(comment_id) {
     var url = AJAX_COMMENT_DELETE_URL.replace('__COMMENT_ID__', comment_id);
     var postData = {};
-    function success(o) {
+    function success() {
         $('#comment-'+comment_id).remove();
         // Ignore that this might leave a stray Add button (or have a pending form with another comment) ...
     }
@@ -807,7 +807,7 @@
         return;
     }
 
-    $comments.each(function(i, e){
+    $comments.each(function(i){
             var prev = '';
             if (i > 0){
                 var prev_anchor = $($comments.get(i-1)).prop('id');
@@ -926,7 +926,7 @@
         });
     CodeMirror.modeURL = baseUrl + "/codemirror/mode/%N/%N.js";
 
-    $('#reset').click(function(e){
+    $('#reset').click(function(){
             window.location=resetUrl;
         });
 
@@ -967,7 +967,7 @@
 
 /* generate links for multi line selects that can be shown by files.html page_highlights.
  * This is a mouseup handler for hlcode from CodeHtmlFormatter and pygmentize */
-function getSelectionLink(e) {
+function getSelectionLink() {
     //get selection from start/to nodes
     if (typeof window.getSelection != "undefined") {
         var s = window.getSelection();
@@ -1136,12 +1136,12 @@
         ajax: {
             url: pyroutes.url('users_and_groups_data'),
             dataType: 'json',
-            data: function(term, page){
+            data: function(term){
               return {
                 query: term
               };
             },
-            results: function (data, page){
+            results: function (data){
               return data;
             },
             cache: true
@@ -1160,13 +1160,13 @@
         ajax: {
             url: pyroutes.url('users_and_groups_data'),
             dataType: 'json',
-            data: function(term, page){
+            data: function(term){
               return {
                 query: term,
                 types: 'users,groups'
               };
             },
-            results: function (data, page){
+            results: function (data){
               return data;
             },
             cache: true
@@ -1196,7 +1196,7 @@
           }
         );
       },
-      sorter: function(query, items, searchKey) {
+      sorter: function(query, items) {
         return items;
       }
     },
@@ -1267,7 +1267,7 @@
     }
 }
 
-function removeReviewMember(reviewer_id, repo_name, pull_request_id){
+function removeReviewMember(reviewer_id){
     var $li = $('#reviewer_{0}'.format(reviewer_id));
     $li.find('div div').css("text-decoration", "line-through");
     $li.find('input').prop('name', 'review_members_removed');
@@ -1283,12 +1283,12 @@
         ajax: {
             url: pyroutes.url('users_and_groups_data'),
             dataType: 'json',
-            data: function(term, page){
+            data: function(term){
               return {
                 query: term
               };
             },
-            results: function (data, page){
+            results: function (data){
               return data;
             },
             cache: true
@@ -1322,7 +1322,7 @@
 }
 
 function ajaxActionRevokePermission(url, obj_id, obj_type, field_id, extra_data) {
-    function success(o) {
+    function success() {
             $('#' + field_id).remove();
         }
     function failure(o) {
@@ -1365,10 +1365,10 @@
             return false;
         }).remove();
 
-    $('#add_element').click(function(e){
+    $('#add_element').click(function(){
             $selectedselect.append($availableselect.children('option:selected'));
         });
-    $('#remove_element').click(function(e){
+    $('#remove_element').click(function(){
             $availableselect.append($selectedselect.children('option:selected'));
         });
 
--- a/kallithea/public/js/graph.js	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/public/js/graph.js	Fri Jan 10 00:34:22 2020 +0100
@@ -34,7 +34,7 @@
 	if (!document.createElement("canvas").getContext)
 		this.canvas = window.G_vmlCanvasManager.initElement(this.canvas);
 	if (!this.canvas) { // canvas creation did for some reason fail - fail silently
-		this.render = function(data) {};
+		this.render = function() {};
 		return;
 	}
 	this.ctx = this.canvas.getContext('2d');
--- a/kallithea/templates/admin/auth/auth_settings.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/admin/auth/auth_settings.html	Fri Jan 10 00:34:22 2020 +0100
@@ -108,7 +108,7 @@
 <script>'use strict';
     $('.toggle-plugin').click(function(e){
         var $auth_plugins_input = $('#auth_plugins');
-        function notEmpty(element, index, array) {
+        function notEmpty(element) {
             return (element != "");
         }
         var elems = $auth_plugins_input.val().split(',').filter(notEmpty);
--- a/kallithea/templates/admin/gists/edit.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/admin/gists/edit.html	Fri Jan 10 00:34:22 2020 +0100
@@ -117,7 +117,7 @@
                         });
 
                         // on type the new filename set mode
-                        $filename_input.keyup(function(e){
+                        $filename_input.keyup(function(){
                             var file_data = CodeMirror.getFilenameAndExt(this.value);
                             if(file_data['ext'] != null){
                                 var detected_mode = CodeMirror.findModeByExtension(file_data['ext']) || CodeMirror.findModeByMIME('text/plain');
--- a/kallithea/templates/admin/gists/new.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/admin/gists/new.html	Fri Jan 10 00:34:22 2020 +0100
@@ -93,7 +93,7 @@
                 });
 
                 // on type the new filename set mode
-                $filename_input.keyup(function(e){
+                $filename_input.keyup(function(){
                     var file_data = CodeMirror.getFilenameAndExt(this.value);
                     if(file_data['ext'] != null){
                         var detected_mode = CodeMirror.findModeByExtension(file_data['ext']) || CodeMirror.findModeByMIME('text/plain');
--- a/kallithea/templates/admin/repos/repo_creating.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/admin/repos/repo_creating.html	Fri Jan 10 00:34:22 2020 +0100
@@ -52,7 +52,7 @@
           window.location = ${h.js(h.url('summary_home', repo_name = c.repo))};
       }
     },
-    complete: function(resp, status) {
+    complete: function(resp) {
       if (resp.status == 200){
           // Schedule the next request when the current one's complete
           setTimeout(worker, 1000);
--- a/kallithea/templates/admin/settings/settings_hooks.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/admin/settings/settings_hooks.html	Fri Jan 10 00:34:22 2020 +0100
@@ -53,10 +53,10 @@
 <script>'use strict';
 function delete_hook(hook_id, field_id) {
     var sUrl = ${h.js(h.url('admin_settings_hooks_delete'))};
-    function success(o) {
+    function success() {
             $('#' + field_id).remove();
         }
-    function failure(o) {
+    function failure() {
             alert(${h.js(_('Failed to remove hook'))});
         }
     var postData = {'hook_id': hook_id};
--- a/kallithea/templates/admin/settings/settings_vcs.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/admin/settings/settings_vcs.html	Fri Jan 10 00:34:22 2020 +0100
@@ -71,7 +71,7 @@
 
     <script>'use strict';
         $(document).ready(function(){
-            $('#path_unlock').on('click', function(e){
+            $('#path_unlock').on('click', function(){
                 $('#path_unlock_icon').removeClass('icon-lock');
                 $('#path_unlock_icon').addClass('icon-lock-open-alt');
                 $('#paths_root_path').removeAttr('readonly');
--- a/kallithea/templates/base/base.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/base/base.html	Fri Jan 10 00:34:22 2020 +0100
@@ -192,7 +192,7 @@
           formatSelection: function(obj) {
               return obj.text.html_escape();
           },
-          formatNoMatches: function(term) {
+          formatNoMatches: function() {
               return ${h.jshtml(_('No matches found'))};
           },
           escapeMarkup: function(m) {
@@ -441,7 +441,7 @@
                 sortResults: prefixFirstSort,
                 formatResult: format,
                 formatSelection: format,
-                formatNoMatches: function(term){
+                formatNoMatches: function(){
                     return ${h.jshtml(_('No matches found'))};
                 },
                 containerCssClass: "repo-switcher",
--- a/kallithea/templates/base/perms_summary.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/base/perms_summary.html	Fri Jan 10 00:34:22 2020 +0100
@@ -111,7 +111,7 @@
         function update_show($checkbox){
             var section = $checkbox.data('section');
 
-            var elems = $('.filter_' + section).each(function(el){
+            var elems = $('.filter_' + section).each(function(){
                 var perm_type = $checkbox.data('perm_type');
                 var checked = $checkbox.prop('checked');
                 if(checked){
--- a/kallithea/templates/changelog/changelog.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/changelog/changelog.html	Fri Jan 10 00:34:22 2020 +0100
@@ -90,7 +90,7 @@
 
                 pyroutes.register('changeset_home', ${h.js(h.url('changeset_home', repo_name='%(repo_name)s', revision='%(revision)s'))}, ['repo_name', 'revision']);
 
-                function checkbox_checker(e) {
+                function checkbox_checker() {
                     var $checked_checkboxes = $checkboxes.filter(':checked');
                     var $singlerange = $('#singlerange');
 
@@ -171,7 +171,7 @@
                 });
                 $('#singlerange').click(checkbox_checker);
 
-                $('#rev_range_clear').click(function(e){
+                $('#rev_range_clear').click(function(){
                     $checkboxes.prop('checked', false);
                     checkbox_checker();
                     graph.render(jsdata);
--- a/kallithea/templates/changelog/changelog_table.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/changelog/changelog_table.html	Fri Jan 10 00:34:22 2020 +0100
@@ -112,7 +112,7 @@
 
 <script>'use strict';
   $(document).ready(function() {
-    $('#changesets .expand_commit').on('click',function(e){
+    $('#changesets .expand_commit').on('click',function(){
       $(this).next('.mid').find('.message > div').toggleClass('hidden');
       ${resize_js};
     });
--- a/kallithea/templates/changeset/changeset.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/changeset/changeset.html	Fri Jan 10 00:34:22 2020 +0100
@@ -186,7 +186,7 @@
     ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS
     <script>'use strict';
       $(document).ready(function(){
-          $('.code-difftable').on('click', '.add-bubble', function(e){
+          $('.code-difftable').on('click', '.add-bubble', function(){
               show_comment_form($(this));
           });
 
--- a/kallithea/templates/changeset/diff_block.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/changeset/diff_block.html	Fri Jan 10 00:34:22 2020 +0100
@@ -98,7 +98,7 @@
 <%def name="diff_block_js()">
 <script>'use strict';
 $(document).ready(function(){
-    $('.btn-image-diff-show').click(function(e){
+    $('.btn-image-diff-show').click(function(){
         $('.btn-image-diff-show').hide();
         $('.btn-image-diff-swap').show();
         $('.img-diff-swapable')
--- a/kallithea/templates/compare/compare_cs.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/compare/compare_cs.html	Fri Jan 10 00:34:22 2020 +0100
@@ -73,7 +73,7 @@
     $(document).ready(function(){
         graph.render(jsdata);
 
-        $('.expand_commit').click(function(e){
+        $('.expand_commit').click(function(){
             $(this).next('.mid').find('.message').toggleClass('expanded');
             graph.render(jsdata);
         });
--- a/kallithea/templates/compare/compare_diff.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/compare/compare_diff.html	Fri Jan 10 00:34:22 2020 +0100
@@ -167,7 +167,7 @@
     values_changed();
     $('#compare_org').change(values_changed);
     $('#compare_other').change(values_changed);
-    $('#compare_revs').on('click', function(e){
+    $('#compare_revs').on('click', function(){
         var org = $('#compare_org').select2('data');
         var other = $('#compare_other').select2('data');
         if (!org || !other) {
--- a/kallithea/templates/files/files_add.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/files/files_add.html	Fri Jan 10 00:34:22 2020 +0100
@@ -107,7 +107,7 @@
                     });
 
                     // on type the new filename set mode
-                    $filename_input.keyup(function(e){
+                    $filename_input.keyup(function(){
                         var file_data = CodeMirror.getFilenameAndExt(this.value);
                         if(file_data['ext'] != null){
                             var detected_mode = CodeMirror.findModeByExtension(file_data['ext']) || CodeMirror.findModeByMIME('text/plain');
--- a/kallithea/templates/index_base.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/index_base.html	Fri Jan 10 00:34:22 2020 +0100
@@ -51,7 +51,7 @@
                 columns: [
                     {data: "raw_name", visible: false, searchable: false},
                     {title: ${h.jshtml(_('Repository'))}, data: "name", orderData: [0,], render: {
-                        filter: function(data, type, row, meta) {
+                        filter: function(data, type, row) {
                             return row.just_name;
                         }
                     }},
--- a/kallithea/templates/pullrequests/pullrequest.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/pullrequests/pullrequest.html	Fri Jan 10 00:34:22 2020 +0100
@@ -170,7 +170,7 @@
           pendingajax.abort();
           pendingajax = undefined;
       }
-      pendingajax = asynchtml(url, $('#pull_request_overview'), function(o){
+      pendingajax = asynchtml(url, $('#pull_request_overview'), function(){
           pendingajax = undefined;
       });
   }
@@ -186,14 +186,14 @@
           maxResults: 50,
           sortResults: branchSort
       });
-      $("#org_ref").on("change", function(e){
+      $("#org_ref").on("change", function(){
           loadPreview();
       });
 
       $("#other_repo").select2({
           dropdownAutoWidth: true
       });
-      $("#other_repo").on("change", function(e){
+      $("#other_repo").on("change", function(){
           otherrepoChanged();
       });
 
@@ -202,7 +202,7 @@
           maxResults: 50,
           sortResults: branchSort
       });
-      $("#other_ref").on("change", function(e){
+      $("#other_ref").on("change", function(){
           loadPreview();
       });
 
--- a/kallithea/templates/pullrequests/pullrequest_show.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/pullrequests/pullrequest_show.html	Fri Jan 10 00:34:22 2020 +0100
@@ -348,7 +348,7 @@
           PullRequestAutoComplete($('#user'));
           SimpleUserAutoComplete($('#owner'));
 
-          $('.code-difftable').on('click', '.add-bubble', function(e){
+          $('.code-difftable').on('click', '.add-bubble', function(){
               show_comment_form($(this));
           });
 
@@ -368,7 +368,7 @@
               $('#pr-form-clone').prop('disabled',!update);
           });
           var $org_review_members = $('#review_members').clone();
-          $('#pr-form-reset').click(function(e){
+          $('#pr-form-reset').click(function(){
               $('.pr-do-edit').hide();
               $('.pr-not-edit').show();
               $('#pr-form-save').prop('disabled',false);
--- a/kallithea/templates/summary/statistics.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/summary/statistics.html	Fri Jan 10 00:34:22 2020 +0100
@@ -156,8 +156,7 @@
         bars: {show:true, align: 'center', lineWidth: 4},
         legend: {show:true,
                 container: "#legend_container",
-                labelFormatter: function(label, series) {
-                        // series is the series object for the label
+                labelFormatter: function(label) {
                         return '<a href="javascript:void(0)"> ' + label + '</a>';
                     }
         },
@@ -205,8 +204,6 @@
 
     /**
      * generate checkboxes accordingly to data
-     * @param keys
-     * @returns
      */
     function generateCheckboxes(data) {
         //append checkboxes
--- a/kallithea/templates/summary/summary.html	Fri Jan 10 00:34:22 2020 +0100
+++ b/kallithea/templates/summary/summary.html	Fri Jan 10 00:34:22 2020 +0100
@@ -240,7 +240,7 @@
 
 <script>'use strict';
 $(document).ready(function(){
-    $('#clone-url input').click(function(e){
+    $('#clone-url input').click(function(){
         if($(this).hasClass('selected')){
             $(this).removeClass('selected');
             return ;
@@ -254,17 +254,17 @@
     var $clone_by_name = $('#clone_by_name');
     var $clone_by_id = $('#clone_by_id');
     var $clone_ssh = $('#clone_ssh');
-    $clone_url.on('click', '.btn.use-name', function(e){
+    $clone_url.on('click', '.btn.use-name', function(){
         $clone_by_name.show();
         $clone_by_id.hide();
         $clone_ssh.hide();
     });
-    $clone_url.on('click', '.btn.use-id', function(e){
+    $clone_url.on('click', '.btn.use-id', function(){
         $clone_by_id.show();
         $clone_by_name.hide();
         $clone_ssh.hide();
     });
-    $clone_url.on('click', '.btn.use-ssh', function(e){
+    $clone_url.on('click', '.btn.use-ssh', function(){
         $clone_by_id.hide();
         $clone_by_name.hide();
         $clone_ssh.show();