# HG changeset patch # User Mads Kiilerich # Date 1581819801 -3600 # Node ID 54d75eb32509abf07212529f4db2fe63d6549dee # Parent fd92fe65a2abb3e82dd178516ec07ad2be98461d eslint: fix "is assigned a value but never used" diff -r fd92fe65a2ab -r 54d75eb32509 kallithea/public/js/base.js --- a/kallithea/public/js/base.js Fri Jan 10 00:34:22 2020 +0100 +++ b/kallithea/public/js/base.js Sun Feb 16 03:23:21 2020 +0100 @@ -281,10 +281,6 @@ return str_format; })(); - var vsprintf = function(fmt, argv) { - argv.unshift(fmt); - return sprintf.apply(null, argv); - }; return { 'url': function(route_name, params) { var result = route_name; @@ -335,21 +331,6 @@ })(); -/* Invoke all functions in callbacks */ -var _run_callbacks = function(callbacks){ - if (callbacks !== undefined){ - var _l = callbacks.length; - for (var i=0;i<_l;i++){ - var func = callbacks[i]; - if(typeof(func)=='function'){ - try{ - func(); - }catch (err){} - } - } - } -} - /** * turns objects into GET query string */ @@ -534,61 +515,6 @@ /** - * Quick filter widget - * - * @param target: filter input target - * @param nodes: list of nodes in html we want to filter. - * @param display_element function that takes current node from nodes and - * does hide or show based on the node - */ -var q_filter = (function() { - var _namespace = {}; - var namespace = function (target) { - if (!(target in _namespace)) { - _namespace[target] = {}; - } - return _namespace[target]; - }; - return function (target, $nodes, display_element) { - var $q_filter_field = $('#' + target); - var F = namespace(target); - - $q_filter_field.keyup(function () { - clearTimeout(F.filterTimeout); - F.filterTimeout = setTimeout(F.updateFilter, 600); - }); - - F.filterTimeout = null; - - F.updateFilter = function () { - // Reset timeout - F.filterTimeout = null; - - var obsolete = []; - - var req = $q_filter_field.val().toLowerCase(); - - var showing = 0; - $nodes.each(function () { - var n = this; - var target_element = display_element(n); - if (req && n.innerHTML.toLowerCase().indexOf(req) == -1) { - $(target_element).hide(); - } - else { - $(target_element).show(); - showing += 1; - } - }); - - $('#repo_count').html(showing); - /* FIXME: don't hardcode */ - } - } -})(); - - -/** * Comment handling */ @@ -973,8 +899,8 @@ var from = _getIdentNode(s.anchorNode); var till = _getIdentNode(s.focusNode); - var f_int = parseInt(from.id.replace('L','')); - var t_int = parseInt(till.id.replace('L','')); + //var f_int = parseInt(from.id.replace('L','')); + //var t_int = parseInt(till.id.replace('L','')); var yoffset = 35; var ranges = [parseInt(from.id.replace('L','')), parseInt(till.id.replace('L',''))]; @@ -1008,44 +934,6 @@ * Autocomplete functionality */ -// Custom search function for the DataSource of users -var autocompleteMatchUsers = function (sQuery, myUsers) { - // Case insensitive matching - var query = sQuery.toLowerCase(); - var i = 0; - var l = myUsers.length; - var matches = []; - - // Match against each name of each contact - for (; i < l; i++) { - var contact = myUsers[i]; - if (((contact.fname+"").toLowerCase().indexOf(query) > -1) || - ((contact.lname+"").toLowerCase().indexOf(query) > -1) || - ((contact.nname) && ((contact.nname).toLowerCase().indexOf(query) > -1))) { - matches[matches.length] = contact; - } - } - return matches; -}; - -// Custom search function for the DataSource of userGroups -var autocompleteMatchGroups = function (sQuery, myGroups) { - // Case insensitive matching - var query = sQuery.toLowerCase(); - var i = 0; - var l = myGroups.length; - var matches = []; - - // Match against each name of each group - for (; i < l; i++) { - var matched_group = myGroups[i]; - if (matched_group.grname.toLowerCase().indexOf(query) > -1) { - matches[matches.length] = matched_group; - } - } - return matches; -}; - // Highlight the snippet if it is found in the full text, while escaping any existing markup. // Snippet must be lowercased already. function autocompleteHighlightMatch(full, snippet) { @@ -1210,24 +1098,6 @@ } -// Set caret at the given position in the input element -function _setCaretPosition($inputElement, caretPos) { - $inputElement.each(function(){ - if(this.createTextRange) { // IE - var range = this.createTextRange(); - range.move('character', caretPos); - range.select(); - } - else if(this.selectionStart) { // other recent browsers - this.focus(); - this.setSelectionRange(caretPos, caretPos); - } - else // last resort - very old browser - this.focus(); - }); -} - - function addReviewMember(id,fname,lname,nname,gravatar_link,gravatar_size){ var displayname = nname; if ((fname != "") && (lname != "")) { diff -r fd92fe65a2ab -r 54d75eb32509 kallithea/public/js/graph.js --- a/kallithea/public/js/graph.js Fri Jan 10 00:34:22 2020 +0100 +++ b/kallithea/public/js/graph.js Sun Feb 16 03:23:21 2020 +0100 @@ -109,9 +109,9 @@ const in_l = cur[1]; const closing = cur[2]; const obsolete_node = cur[3]; - const bumped_node = cur[4]; - const divergent_node = cur[5]; - const extinct_node = cur[6]; + //const bumped_node = cur[4]; + //const divergent_node = cur[5]; + //const extinct_node = cur[6]; const unstable_node = cur[7]; // center dots on the first element in a td (not necessarily the first one, but there must be one) diff -r fd92fe65a2ab -r 54d75eb32509 kallithea/templates/admin/my_account/my_account_repos.html --- a/kallithea/templates/admin/my_account/my_account_repos.html Fri Jan 10 00:34:22 2020 +0100 +++ b/kallithea/templates/admin/my_account/my_account_repos.html Sun Feb 16 03:23:21 2020 +0100 @@ -6,7 +6,7 @@