Skip to content

Commit 44ed223

Browse files
committed
Improved the rate my professor search to use both last and first name instead of just last.
(Requested on this issue: #84 )
1 parent d1c1600 commit 44ed223

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

assets/src/modules/sm/App/providers/RMPUrlFilter.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
angular.module('sm').filter('RMPUrl', function() {
33
return function(input) {
44
if(input && input != "TBA") {
5-
var nameParts = input.split(" "),
6-
lastName = nameParts[nameParts.length - 1];
7-
return '<a target="_blank" href="http://www.ratemyprofessors.com/search.jsp?queryBy=teacherName&queryoption=HEADER&query=' + lastName + '&facetSearch=true&schoolName=rochester+institute+of+technology">' + input + '</a>';
5+
var EscapedName = input.replace(/ /g, "+");
6+
return '<a target="_blank" href="http://www.ratemyprofessors.com/search.jsp?queryBy=teacherName&queryoption=HEADER&query=' + EscapedName + '&facetSearch=true&schoolName=rochester+institute+of+technology">' + input + '</a>';
87
} else {
98
return '<a href="#">' + input + '</a>';
109
}

0 commit comments

Comments
 (0)