arnaucube
arnaucube/openworktimePublic Self-hosted repository
openworktime/webapp/controllers.js
webapp/controllers.jsRaw
 1
 2angular.module('workApp', [])
 3  .controller('workController', function(
 4        $scope, $http
 5    ) {
 6    $scope.username="";
 7
 8    if(localStorage.getItem('w_username')){
 9        $scope.username=localStorage.getItem('w_username');
10    }
11
12    $scope.onNew = function(){
13
14    };
15
16    $scope.openCode = function(){
17        toastr.info("Visiting code");
18        var urlCode="https://github.com/idoctnef/openworktime";
19        if(typeof process !== 'undefined'){
20            console.log(process.versions['electron']);
21            const {shell} = require('electron');
22
23            shell.openExternal(urlCode);
24        }else{
25            window.open(urlCode);
26        }
27    };
28
29  });