GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( da5f76...59bb8c )
by Keith
76:35
created

46list-and-amend-staff-profile.js ➔ Initialize   A

Complexity

Conditions 2

Size

Total Lines 8
Code Lines 6

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
dl 8
loc 8
rs 10
c 0
b 0
f 0
1 View Code Duplication
"use strict";
2
  app.controller('staffProfileAmendController', ['$scope', '$element', function ($scope, $element, $rootScope) {
3
      function Initialize(){
4
      var entryForm = {};    
5
      $scope.entryForm = entryForm;
6
      $scope.directiveDict = {};
7
8
      $scope.deptEditBox = {};
9
      $scope.sectionEditBox = {};
10
      }
11
      Initialize();
12
13
      $scope.SetDefaultValue = function(scope, iElement, iAttrs, controller){
14
          // entryForm.StaffID = "";
15
          // entryForm.Surname = "";
16
          // entryForm.GivenName = "";
17
          // entryForm.ChineseName = "";
18
19
      controller.ngModel.DateOfBirth = new Date(0, 0, 0);
20
      controller.ngModel.EmployeeDate = new Date(0, 0, 0);
21
      }
22
23
    $scope.EventListener = function(scope, iElement, iAttrs, controller){
24
      console.log("<"+iElement[0].tagName+">" +" Directive overried EventListener()");
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
25
      var prgmID = scope.programId;
26
      var tagName = iElement[0].tagName.toLowerCase();
27
      var editMode = "";
28
29
      if(tagName == "entry") editMode = iAttrs.editMode;
30
31
      if(!prgmID)
32
        return;
33
34
      var varName = prgmID;//tagName + prgmID + editMode;
35
      varName = varName.toLowerCase();
36
37
      if($scope.directiveDict[varName] == null || typeof($scope.directiveDict[varName]) == "undefined"){
38
        $scope.directiveDict[varName] = scope;
39
      }
40
41
      // console.dir(scope);
42
      // console.dir(iElement);
43
      // console.dir(iAttrs);
44
      // console.dir(controller);
45
46
      //http://api.jquery.com/Types/#Event
47
      //The standard events in the Document Object Model are:
48
      // blur, focus, load, resize, scroll, unload, beforeunload,
49
      // click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave,
50
      // change, select, submit, keydown, keypress, and keyup.
51
      iElement.ready(function() {
52
53
      })
54
    }
55
56
    $scope.CustomSelectedToRecord = function(sRecord, rowScope, scope, iElement, controller){
57
      console.log("<"+iElement[0].tagName+">" +" Directive overried CustomPointedToRecord()");
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
58
59
      var tagName = iElement[0].tagName.toLowerCase();
60
      var prgmID = scope.programId.toLowerCase();
61
62
      if(prgmID == "hw01sm"){
63
        // asign the selected record to ng-model
64
        $.extend(true, $scope.entryForm, sRecord)
65
      }
66
67
      if(prgmID == "dw01dp"){
68
        // asign the selected record to ng-model
69
        $scope.entryForm.DeptCode = sRecord.DepartmentCode;
70
      }
71
72
      else if (prgmID == "dw02se"){
73
        $scope.entryForm.SectionCode = sRecord.SectionCode; 
74
      }
75
76
    }
77
    
78
    $scope.ValidateBuffer = function(scope, iElement, iAttrs, controller){
79
      controller.ngModel.FullName = controller.ngModel.LastName + ' ' +  controller.ngModel.FirstName;
80
81
      return true;
82
    };
83
84
  }]);