Issues (103)

app/js/renderer.js (5 issues)

1
// jshint esversion: 8, -W104, -W069
2
3
// Base path --> assets/html
4
const electron = require('electron'),
5
  path = require('path'),
0 ignored issues
show
The constant path seems to be never used. Consider removing it.
Loading history...
6
  app = electron.remote.app,
7
  fs = require('fs');
8
9
const {
10
    ipcRenderer,
11
    remote,
12
    dialog
13
  } = electron;
14
15
window.$ = window.jQuery = require('jquery');
16
17
require('../js/renderer/index');
18
19
var settings = require('../js/common/settings').load();
20
21
/*
22
  $(document).ready(function() {...});
23
    When document is ready
24
 */
25
$(document).ready(function() {
26
  const {
27
    'custom.configuration': configuration
28
  } = settings;
29
30
  ipcRenderer.send('app:debug', "Document is ready");
31
32
  // Load custom configuration at startup
33
  if (fs.existsSync(app.getPath('userData') + configuration.filepath)) {
0 ignored issues
show
The variable configuration seems to be never declared. If this is a global, consider adding a /** global: configuration */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
34
    ipcRenderer.send('app:debug', "Reading persistent configurations");
35
    settings = fs.readFile(app.getPath('userData') + configuration.filepath);
36
  } else {
37
    ipcRenderer.send('app:debug', "Using default configurations");
38
  }
39
40
  startup();
41
  require('../js/renderer/navigation');
42
  
43
  return;
0 ignored issues
show
This return has no effect and can be removed.
Loading history...
44
});
45
46
/*
47
  startup
48
    Application startup checks
49
 */
50
function startup() {
51
  const {
52
    'app.window.navigation': navigation
53
  } = settings;
54
55
  ipcRenderer.send('app:debug', "'navigation.developerTools': {0}".format(navigation.developerTools));
0 ignored issues
show
The variable navigation seems to be never declared. If this is a global, consider adding a /** global: navigation */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
56
  if (navigation.developerTools) $('#navTabDevtools').removeClass('is-force-hidden');
57
58
  ipcRenderer.send('app:debug', "'navigation.extendedcollapsed': {0}".format(navigation.extendedCollapsed));
59
  if (navigation.extendedCollapsed) {
60
    $('#navButtonExpandedmenu').toggleClass('is-active');
61
    $('.is-specialmenu').toggleClass('is-hidden');
62
  }
63
64
  ipcRenderer.send('app:debug', "'navigation.extendedmenu': {0}".format(navigation.enableExtendedMenu));
65
  if (navigation.enableExtendedMenu) $('#navButtonExpandedmenu').addClass('is-force-hidden');
66
67
  return;
0 ignored issues
show
This return has no effect and can be removed.
Loading history...
68
}
69