<commit_before>/**
 * Created by noel on 07/12/2015.
 */
(function(){
    var app = angular.module("Balance");
    app.controller("SettingController",['$http','$location','$window','$timeout','$scope','$localStorage',function($http,$location,$window,$timeout,$scope,$localStorage){
        //$window.localStorage.clear();


        //Variable definition
        /*
            Elements to edit:
                Workers
                    Edit Value and types of values
                Payments
                    Add new payment type, edit payment types, discounts and percents
                Hires
                    Edit text and variables that will be included on hire time
         */


        var self=this; //to access scope within callbacks

        //Control variable
        this.selected = false;
        this.hireShow = false;
        this.name = false;
        this.nominasShow=false;


        /*#################################
        Edit worker section     ~##########
        ################################*/


        this.nameFields = []; // Empty initial fields
        //CRUD Operation

        //CREATE
        this.addWorkerValue = function(value){
            console.log("add param");
            var newObject = {value:value.value,editing:false,type:value.type};
            self.nameFields.push(newObject);
            self.updateParams();
        };


        //RETRIEVE HTTP RETRIEVE TEMPORALLY COMMENTED OUT
        this.getParams = function(){
            console.log("getParamenters");
            console.log($localStorage.WorkerParams);
            $localStorage.WorkerParams.forEach(function(element){
               element.editing = false;
            });
            self.nameFields = $localStorage.WorkerParams;

        };

        /*this.getParams = function(){
            $http({
                method:'GET',
                url:'http://192.168.3.11:8080/api/trabajadores/getParams'
            }).success(function(data){
                console.log(data.parameters);
                var parameters = data.parameters;
                self.values = [];
                var array = parameters.split("__");
                self.nameFields=[];
                array.forEach(function(param){
                    var object = {value:param,editing:false};
                    param.editing=false;
                    self.nameFields.push(object);
                });
                angular.element(document).ready(function () {
                    console.log("document ready");
                    $('select').material_select();
                });
<commit_msg>worker params fixed init<commit_after>/**
 * Created by noel on 07/12/2015.
 */
(function(){
    var app = angular.module("Balance");
    app.controller("SettingController",['$http','$location','$window','$timeout','$scope','$localStorage',function($http,$location,$window,$timeout,$scope,$localStorage){
        //$window.localStorage.clear();


        //Variable definition
        /*
            Elements to edit:
                Workers
                    Edit Value and types of values
                Payments
                    Add new payment type, edit payment types, discounts and percents
                Hires
                    Edit text and variables that will be included on hire time
         */


        var self=this; //to access scope within callbacks

        //Control variable
        this.selected = false;
        this.hireShow = false;
        this.name = false;
        this.nominasShow=false;


        /*#################################
        Edit worker section     ~##########
        ################################*/


        this.nameFields = []; // Empty initial fields
        //CRUD Operation

        //CREATE
        this.addWorkerValue = function(value){
            console.log("add param");
            var newObject = {value:value.value,editing:false,type:value.type};
            self.nameFields.push(newObject);
            self.updateParams();
        };


        //RETRIEVE HTTP RETRIEVE TEMPORALLY COMMENTED OUT
        this.getParams = function(){
            console.log("getParamenters");
			if ($localStorage.WorkerParams == undefined){
				$localStorage.WorkerParams = [];
			}
            console.log($localStorage.WorkerParams);
            $localStorage.WorkerParams.forEach(function(element){
               element.editing = false;
            });
            self.nameFields = $localStorage.WorkerParams;

        };

        /*this.getParams = function(){
            $http({
                method:'GET',
                url:'http://192.168.3.11:8080/api/trabajadores/getParams'
            }).success(function(data){
                console.log(data.parameters);
                var parameters = data.parameters;
                self.values = [];
                var array = parameters.split("__");
                self.nameFields=[];
                array.forEach(function(param){
                    var object = {value:param,editing:false};
                    param.editing=false;
                    self.nameFields.push(object);
                });
                angular.element(document).ready(function () {
                    console.log("document ready");
                    $('select').material_select();
                });

{'fraction_non_alphanumeric': 0.14285714285714285, 'fraction_numerical': 0.007894736842105263, 'mean_word_length': 1.6900910010111223, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3709300', 'n_tokens_mistral': 1358, 'n_tokens_neox': 1234, 'n_words': 251}