Skip to content

Commit

Permalink
Rename autocomplete.js publiclab#241 (publiclab#245)
Browse files Browse the repository at this point in the history
* Rename autocomplete.js

* community-toolbox.js

* grunt build add

* fixed path

* fix tabs

* Revert "fix tabs"

This reverts commit 42efc28.

* Revert "fixed path"

This reverts commit 4df7151.

* Revert "grunt build add"

This reverts commit 52dcbdf.

* run grunt
  • Loading branch information
airdry authored and Rishabh570 committed Jul 31, 2019
1 parent 9d2cb85 commit 2ae45b5
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 62 deletions.
114 changes: 56 additions & 58 deletions dist/community-toolbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -26696,7 +26696,7 @@ module.exports={
"_args": [
[
"[email protected]",
"/home/rishabh570/community-toolbox"
"/media/composer/3D22506F712D3C45/Knowludge/project/community-toolbox"
]
],
"_development": true,
Expand All @@ -26722,7 +26722,7 @@ module.exports={
],
"_resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",
"_spec": "6.4.1",
"_where": "/home/rishabh570/community-toolbox",
"_where": "/media/composer/3D22506F712D3C45/Knowludge/project/community-toolbox",
"author": {
"name": "Fedor Indutny",
"email": "[email protected]"
Expand Down Expand Up @@ -27566,7 +27566,7 @@ module.exports={
"_args": [
[
"git://github.com/jywarren/github-api-simple.git#patch-2",
"/home/rishabh570/community-toolbox"
"/media/composer/3D22506F712D3C45/Knowludge/project/community-toolbox"
]
],
"_development": true,
Expand All @@ -27589,7 +27589,7 @@ module.exports={
],
"_resolved": "git://github.com/jywarren/github-api-simple.git#cb5b7f778ea9c8b65641b64b8c02f43cedf6672e",
"_spec": "git://github.com/jywarren/github-api-simple.git#patch-2",
"_where": "/home/rishabh570/community-toolbox",
"_where": "/media/composer/3D22506F712D3C45/Knowludge/project/community-toolbox",
"author": {
"name": "Michiel van der Velde",
"email": "[email protected]"
Expand Down Expand Up @@ -77488,7 +77488,7 @@ module.exports={
"_args": [
[
"[email protected]",
"/home/rishabh570/community-toolbox"
"/media/composer/3D22506F712D3C45/Knowludge/project/community-toolbox"
]
],
"_development": true,
Expand All @@ -77513,7 +77513,7 @@ module.exports={
],
"_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",
"_spec": "2.4.3",
"_where": "/home/rishabh570/community-toolbox",
"_where": "/media/composer/3D22506F712D3C45/Knowludge/project/community-toolbox",
"author": {
"name": "Jeremy Stashewsky",
"email": "[email protected]"
Expand Down Expand Up @@ -81690,13 +81690,11 @@ function insertIssue(issue, el) {


function insertStale(issues, selector) {
// if(issues!=null && issues!=undefined ) {
// let issuesLen = issues.length;
// $('#stale-head').html('Stale Issues ('+issuesLen+'+)');
// issues.forEach(function (issue) {
// insertIssue(issue, selector);
// })
// }
let issuesLen = issues.length;
$('#stale-head').html('Stale Issues ('+issuesLen+'+)');
issues.forEach(function (issue) {
insertIssue(issue, selector);
})
}


Expand Down Expand Up @@ -81997,7 +81995,7 @@ CommunityToolbox = function CommunityToolbox(org, repo) {
var contributorsUI = require('../UI/contributorsUI')
var contributorsUtil = require('../utils/contribsUtil/main')
var recentContributorsUI = require('../UI/recentContributorsUI')
var autoCompleteUtil = require('../utils/autocomplete')
var navDropdownUtil = require('../utils/navDropdown.js')
var ftoAuthorsUI = require('../UI/ftoAuthorsUI')
var issuesUtil = require('../utils/staleIssuesUtil')
var recentContribsUtil = require('../utils/recentContribsUtil/main')
Expand Down Expand Up @@ -82068,7 +82066,7 @@ CommunityToolbox = function CommunityToolbox(org, repo) {
return model_utils.getItem('repos')
.then((res) => {
if(res!=null && res!=undefined) {
autoCompleteUtil.generateAutocomplete(res);
navDropdownUtil.populateNavDropdown(res);
}else {
console.log("not working");
}
Expand Down Expand Up @@ -82262,42 +82260,7 @@ CommunityToolbox = function CommunityToolbox(org, repo) {

module.exports = CommunityToolbox;

},{"../UI/contributorsUI":399,"../UI/ftoAuthorsUI":400,"../UI/issuesUI":401,"../UI/recentContributorsUI":402,"../models/crud":403,"../models/utils":405,"../utils/autocomplete":408,"../utils/contribsUtil/main":412,"../utils/recentContribsUtil/main":418,"../utils/repoUtil/fetchRepoUtil":421,"../utils/staleIssuesUtil":422,"./chart":406,"github-api-simple":151,"parse-link-header":278,"request-promise":323}],408:[function(require,module,exports){
function generateAutocomplete(repos) {
let repoAlreadySelected = urlHash().getUrlHashParameter('r');

// populates the current dropdown selected html
if(jQuery.isEmptyObject(repoAlreadySelected)) {
repoAlreadySelected = "plots2";
}else {
repoAlreadySelected = (repoAlreadySelected.r == undefined) ? repoAlreadySelected : repoAlreadySelected.r;
}
$('#dropdownMenuButton').html(repoAlreadySelected);


// populates the dropdown list
repos.map((repo,i) => {
$('<p>', {
class: 'dropdown-items',
text: repo
}).appendTo('#dropdown-container');
});


// click handler for dropdown items
$('.dropdown-items').click((e) => {
let repo = e.target.textContent;
urlHash().setUrlHashParameter("r", repo);
$('#dropdownMenuButton').html(repo);
location.reload();
})
}



module.exports.generateAutocomplete = generateAutocomplete;

},{}],409:[function(require,module,exports){
},{"../UI/contributorsUI":399,"../UI/ftoAuthorsUI":400,"../UI/issuesUI":401,"../UI/recentContributorsUI":402,"../models/crud":403,"../models/utils":405,"../utils/contribsUtil/main":411,"../utils/navDropdown.js":413,"../utils/recentContribsUtil/main":418,"../utils/repoUtil/fetchRepoUtil":421,"../utils/staleIssuesUtil":422,"./chart":406,"github-api-simple":151,"parse-link-header":278,"request-promise":323}],408:[function(require,module,exports){
let SimpleApi = require("github-api-simple")
let api = new SimpleApi()
let model_utils = require('../../models/utils')
Expand Down Expand Up @@ -82362,7 +82325,7 @@ function fetchAllRepoContribs(org, repo) {
module.exports = {
fetchAllRepoContribs: fetchAllRepoContribs
}
},{"../../models/utils":405,"github-api-simple":151,"parse-link-header":278}],410:[function(require,module,exports){
},{"../../models/utils":405,"github-api-simple":151,"parse-link-header":278}],409:[function(require,module,exports){
let SimpleApi = require("github-api-simple")
let api = new SimpleApi()
let model_utils = require('../../models/utils')
Expand Down Expand Up @@ -82398,7 +82361,7 @@ function fetchRepoContribs(org, repo) {
module.exports = {
fetchRepoContribs: fetchRepoContribs
}
},{"../../models/utils":405,"github-api-simple":151}],411:[function(require,module,exports){
},{"../../models/utils":405,"github-api-simple":151}],410:[function(require,module,exports){
let fetchAllRepoContribs = require('./fetchAllRepoContribs')
let fetchRepoContribs = require('./fetchRepoContribs')

Expand All @@ -82419,7 +82382,7 @@ function fetchRepoContributorsUtil(org, repo) {
module.exports = {
fetchRepoContributorsUtil: fetchRepoContributorsUtil
}
},{"./fetchAllRepoContribs":409,"./fetchRepoContribs":410}],412:[function(require,module,exports){
},{"./fetchAllRepoContribs":408,"./fetchRepoContribs":409}],411:[function(require,module,exports){
let fetchRepoContribsUtil = require('./fetchRepoContribsUtil')
let storeAllContribsInDb = require('./storeAllContribsInDb')

Expand Down Expand Up @@ -82457,7 +82420,7 @@ module.exports = {
}


},{"./fetchRepoContribsUtil":411,"./storeAllContribsInDb":413}],413:[function(require,module,exports){
},{"./fetchRepoContribsUtil":410,"./storeAllContribsInDb":412}],412:[function(require,module,exports){
let fetchRepoContributorsUtil = require('./fetchRepoContribsUtil')
let model_utils = require('../../models/utils')

Expand All @@ -82474,8 +82437,8 @@ function storeAllContribsInDb(org) {
return model_utils.getItem('repos').then((res) => {
let splicedRepos = res.splice(0, 20);
splicedRepos.map(function mappingToEachRepo(Repo, i) {
let promise = fetchRepoContributorsUtil.fetchRepoContributorsUtil(org, Repo)
.then(function gotRepoContributorsInStorage(contributors) {
let promise = fetchRepoContributorsUtil.fetchRepoContributorsUtil(org, Repo)
.then(function gotRepoContributorsInStorage(contributors) {
if(contributors!=undefined && contributors.length>0) {
contributors.map((contributor, i)=> {
if(!contributorSet.has(contributor.login)) {
Expand Down Expand Up @@ -82521,7 +82484,42 @@ function storeAllContribsInDb(org) {
module.exports = {
storeAllContribsInDb: storeAllContribsInDb
}
},{"../../models/utils":405,"./fetchRepoContribsUtil":411}],414:[function(require,module,exports){
},{"../../models/utils":405,"./fetchRepoContribsUtil":410}],413:[function(require,module,exports){
function populateNavDropdown(repos) {
let repoAlreadySelected = urlHash().getUrlHashParameter('r');

// populates the current dropdown selected html
if(jQuery.isEmptyObject(repoAlreadySelected)) {
repoAlreadySelected = "plots2";
}else {
repoAlreadySelected = (repoAlreadySelected.r == undefined) ? repoAlreadySelected : repoAlreadySelected.r;
}
$('#dropdownMenuButton').html(repoAlreadySelected);


// populates the dropdown list
repos.map((repo,i) => {
$('<p>', {
class: 'dropdown-items',
text: repo
}).appendTo('#dropdown-container');
});


// click handler for dropdown items
$('.dropdown-items').click((e) => {
let repo = e.target.textContent;
urlHash().setUrlHashParameter("r", repo);
$('#dropdownMenuButton').html(repo);
location.reload();
})
}



module.exports.populateNavDropdown = populateNavDropdown;

},{}],414:[function(require,module,exports){
let model_utils = require('../../models/utils');

// Fetches recent month commits for top 10 repositories
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/community-toolbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CommunityToolbox = function CommunityToolbox(org, repo) {
var contributorsUI = require('../UI/contributorsUI')
var contributorsUtil = require('../utils/contribsUtil/main')
var recentContributorsUI = require('../UI/recentContributorsUI')
var autoCompleteUtil = require('../utils/autocomplete')
var navDropdownUtil = require('../utils/navDropdown.js')
var ftoAuthorsUI = require('../UI/ftoAuthorsUI')
var issuesUtil = require('../utils/staleIssuesUtil')
var recentContribsUtil = require('../utils/recentContribsUtil/main')
Expand Down Expand Up @@ -83,7 +83,7 @@ CommunityToolbox = function CommunityToolbox(org, repo) {
return model_utils.getItem('repos')
.then((res) => {
if(res!=null && res!=undefined) {
autoCompleteUtil.generateAutocomplete(res);
navDropdownUtil.populateNavDropdown(res);
}else {
console.log("not working");
}
Expand Down
4 changes: 2 additions & 2 deletions src/utils/autocomplete.js → src/utils/navDropdown.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function generateAutocomplete(repos) {
function populateNavDropdown(repos) {
let repoAlreadySelected = urlHash().getUrlHashParameter('r');

// populates the current dropdown selected html
Expand Down Expand Up @@ -30,4 +30,4 @@ function generateAutocomplete(repos) {



module.exports.generateAutocomplete = generateAutocomplete;
module.exports.populateNavDropdown = populateNavDropdown;

0 comments on commit 2ae45b5

Please sign in to comment.