Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
chetandhembre committed Sep 23, 2013
1 parent d41982c commit cca5c87
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ <h1>Mozilla India Developer Leaderboard</h1>
</p>
</div>
<script type="text/javascript" src="users.json"></script>
<script type="text/javascript" src="js/Constans.js"></script>
<script type="text/javascript" src="js/git-repos.json"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/md5.js"></script>
<script type="text/javascript" src="js/bz.js"></script>
<script type="text/javascript" src="js/gh.js"></script>
<script type="text/javascript" src="js/dashboard.js"></script>

</body>
</html>
8 changes: 8 additions & 0 deletions js/Constans.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

/*
store
*/

var Constants = {
BUGZILLA_PROFILE_URL : "https://bugzilla.mozilla.org/user_profile?login="
};
33 changes: 32 additions & 1 deletion js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,37 @@ var numComponentsRecieved = 0;
var gitRecieved = 0;
var gitNumbers = {};

/*
validate email
should remove to utils.js file
*/
function isValidEmailId(emailId) {
var reg = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
if (reg.test(emailId)){
return true;
}
return false;
}



/*
return bugzilla profile url of given email
*/
function add_bugzilla_profile_link(emailId) {

// validate emailId
if(isValidEmailId(emailId)){
return Constants.BUGZILLA_PROFILE_URL + encodeURIComponent(emailId);
} else {
console.error("invalid email id");
return "#";
}
}




function sortResults() {
var table = document.querySelector('#list tbody');
var items = table.childNodes;
Expand Down Expand Up @@ -110,7 +141,7 @@ for (var i = 0; i < users.length; i++) {
}
buffer += '<tr id="' + trimmedEmail + '">' +
'<td><img class="avatar" src="http://www.gravatar.com/avatar/' + hash + '?s=48"></td>' +
'<td><a href="mailto:' + email + '">' + name + '</a></td>' +
'<td><a href="' add_bugzilla_profile_link(email);'">' + name + '</a></td>' +

This comment has been minimized.

Copy link
@grssam

grssam Sep 23, 2013

This is a syntax error.

'<td align="center"><a target="_blank" href="https://bugzilla.mozilla.org/buglist.cgi?quicksearch=ALL%20assignee%3A' + email + '"><span class="badge assigned" value="' + assigned + '">' + assigned + '</span></a></td>' +
'<td align="center"><span class="badge fixed" value="' + fixed + '">' + fixed + '</span></td>' +
'<td align="center"><span class="badge git" value="' + git + '">' + git + '</span></td>' +
Expand Down

2 comments on commit cca5c87

@grssam
Copy link

@grssam grssam commented on cca5c87 Sep 23, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Chetan, thanks for taking this up, but we might want to put you on hold until the server side transfer is complete. We will let you know when you can start working on this issue again :)

@chetandhembre
Copy link
Owner Author

@chetandhembre chetandhembre commented on cca5c87 Sep 24, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.