- Timestamp:
- 11/28/13 09:34:58 (11 years ago)
- Location:
- cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.site/site
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.site/site/partials/accountDetails.html
r4091 r4104 47 47 </span> 48 48 </p> 49 <span class="control-group error" data-ng-show="removeEmailAjaxError"> 50 <small class="help-block"> 51 <div>The server responded with an error. Please try again!</div> 52 <div>If the problem persists contact us at:</div> 53 <div><a href="mailto:tla@mpi.nl">isocat@mpi.nl</a></div> 54 </small> 55 </span> 49 56 <form data-ng-show="edditingEmail" name="editEmailForm" class="form-inline" novalidate="novalidate"> 50 57 <input name="editEmailInput" type="email" required="required" data-ng-model="editEmailText"/> -
cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.site/site/scripts/controllers.js
r4091 r4104 147 147 //controller (next page), thus we have to keep the server data across controller 148 148 //reloads by saving it in the parent scope. 149 parentScope.schemasResult =SchemasList.get({userID:UserService.id,149 SchemasList.get({userID:UserService.id, 150 150 startPage:page, pageSize:$scope.pageSize}, 151 151 function(result){ … … 167 167 loadSchemaMetadata($location.search().schemaIndex); 168 168 169 returnresult;169 parentScope.schemasResult = result; 170 170 }); 171 171 } … … 189 189 //make AJAX call to get the schema metadata for the selected row 190 190 var selectedSchemaRow = parentScope.schemasList[Number(index)]; 191 parentScope.selectedSchema =Schema.get({schemaID:selectedSchemaRow['xml:id']},191 Schema.get({schemaID:selectedSchemaRow['xml:id']}, 192 192 function(result){ 193 193 //when there is just one element we create an array with it, so ng-repeat repeats just once … … 210 210 $scope.animateSchemaChange=''; 211 211 212 parentScope.selectedSchema = result; 212 213 parentScope.resultHasArrived = true; 213 214 }); … … 532 533 function updateAddingEmail(){ 533 534 $scope.waitingForServer = false; 534 $scope.ajaxError = false;535 535 536 if($location.search().addingEmail) 536 537 $scope.addingEmail = true; … … 551 552 552 553 $scope.terminateAddEmail = function (){ 554 $scope.ajaxError = false; 553 555 $scope.newEmailInputText = ''; 554 556 $scope.newEmailForm.$setPristine(); … … 565 567 user.$save({userID:UserService.id}, 566 568 function(result) { 567 if(result['sc:response'] .success){569 if(result['sc:response'] !== undefined && result['sc:response'].success){ 568 570 UserService.email.push(email); 569 571 $scope.newEmailForm.$setPristine(); … … 601 603 user.$save({userID:UserService.id}, 602 604 function(result) { 603 if(result['sc:response'] .success){605 if(result['sc:response'] !== undefined && result['sc:response'].success){ 604 606 $scope.displayName = UserService.displayName = $scope.editDisplayNameText; 605 607 $scope.terminateEditDisplayName(); … … 608 610 //server reports an handeled error 609 611 $scope.waitingForServerEditDisplayName = false; 610 $scope. ajaxError = true;612 $scope.editDisplayNameAjaxError = true; 611 613 } 612 614 }, … … 650 652 function updateEdditingEmail(){ 651 653 $scope.waitingForServerEditEmail = false; 652 $scope.editEmailAjaxError = false;653 654 if($location.search().edditingEmail !== undefined && $location.search().edditingEmail.indexOf($scope.emailInstance) !== -1){ 654 655 if($scope.editEmailText === undefined) … … 662 663 updateEdditingEmail(); 663 664 664 $scope.editEmail = function (emailInstance){ 665 $scope.editEmail = function (emailInstance){ 665 666 var locationSearch = $location.search(); 667 $scope.removeEmailAjaxError = false; 666 668 if(locationSearch.edditingEmail === undefined) 667 669 locationSearch.edditingEmail = emailInstance; … … 681 683 user.$save({userID:UserService.id}, 682 684 function(result) { 683 if(result['sc:response'] .success){685 if(result['sc:response'] !== undefined && result['sc:response'].success){ 684 686 UserService.email.splice(index, 1); 685 687 } … … 687 689 //server reports an handeled error 688 690 $scope.waitingForServerEditEmail = false; 689 $scope. editEmailAjaxError = true;691 $scope.removeEmailAjaxError = true; 690 692 } 691 693 }, … … 693 695 function(){ 694 696 $scope.waitingForServerEditEmail = false; 695 $scope. editEmailAjaxError = true;697 $scope.removeEmailAjaxError = true; 696 698 }); 697 699 }; … … 706 708 user.$save({userID:UserService.id}, 707 709 function(result) { 708 if(result['sc:response'] .success){710 if(result['sc:response'] !== undefined && result['sc:response'].success){ 709 711 $scope.cancelEditEmail(UserService.email[index]); 710 712 UserService.email[index] = $scope.editEmailText; … … 726 728 $scope.cancelEditEmail = function (emailInstance){ 727 729 var locationSearch = $location.search(); 728 730 $scope.editEmailAjaxError = false; 729 731 $scope.editEmailText = undefined; 730 732 … … 788 790 user.$save({userID:UserService.id}, 789 791 function(result) { 790 if(result['sc:response'] .success)792 if(result['sc:response'] !== undefined && result['sc:response'].success) 791 793 document.location.pathname = "schemacat/site/index.html"; 792 794 else {
Note: See TracChangeset
for help on using the changeset viewer.