33< head >
44 < meta charset ="utf-8 ">
55 < meta name ="viewport " content ="width=device-width, initial-scale=1, shrink-to-fit=no ">
6+ < title > Generate - GitHub Graphs</ title >
67 < link rel ="icon " href ="./favicon.ico " type ="image/x-icon " />
78 < link rel ="shortcut icon " href ="./favicon.ico " type ="image/x-icon " />
89 < link rel ="stylesheet " href ="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css " integrity ="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T " crossorigin ="anonymous ">
@@ -123,27 +124,43 @@ <h1 class="m-title">Interactive Organization Chart</h1>
123124< script >
124125 function fetchUserInput ( ) {
125126 const inputedName = $ ( "#txtUsername" ) . val ( ) ;
127+
128+ if ( inputedName === "" )
129+ {
130+ alert ( "Please enter a Github name in the text field." )
131+ }
132+
126133 return inputedName ;
127134 }
128135
129- function fetchOrgInput ( ) {
136+ function fetchOrgInput ( )
137+ {
130138 const inputedOrg = $ ( "#txtOrgname" ) . val ( ) ;
139+ if ( inputedOrg === "" )
140+ {
141+ alert ( "Please enter a Github organization name in the text field." )
142+ }
131143 return inputedOrg ;
132144 }
133145
134- function toFriends ( ) {
146+ function toFriends ( )
147+ {
135148 var uname = fetchUserInput ( ) ;
136- window . location . href = "./FriendsGraph.html?name=" + uname ;
149+ if ( uname !== "" )
150+ window . location . href = "./FriendsGraph.html?name=" + uname ;
137151 }
138152
139- function toTimeline ( ) {
153+ function toTimeline ( )
154+ {
140155 var uname = fetchUserInput ( ) ;
141- window . location . href = "./TimeLineGraph.html?name=" + uname ;
156+ if ( uname !== "" )
157+ window . location . href = "./TimeLineGraph.html?name=" + uname ;
142158 }
143159
144160 function toOrgRepos ( ) {
145- var oname = fetchOrgInput ( ) ;
146- window . location . href = "./OrgRepoGraph.html?name=" + oname ;
161+ var uname = fetchOrgInput ( ) ;
162+ if ( uname !== "" )
163+ window . location . href = "./OrgRepoGraph.html?name=" + uname ;
147164 }
148165
149166</ script >
0 commit comments