forked from mendix/WDPForBrackets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
97 lines (69 loc) · 3.61 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */
/*global define, $, brackets */
/** Simple extension that adds a "File > Hello World" menu item. Inserts "Hello, world!" at cursor pos. */
define(function (require, exports, module) {
'use strict';
var ExtensionManager = brackets.getModule('extensibility/ExtensionManager');
// Variables to define the extension.
var MODULE_NAME = 'mendix.wdpforbrackets',
// External libraries
JSBeautify = null,
CodeFolding = null,
JSIndentator = null,
// External managers.
ExtensionUtils = brackets.getModule('utils/ExtensionUtils'),
AppInit = brackets.getModule('utils/AppInit'),
// JSHint
JSHint = require('extension/jshint/main'),
// Snippets
MendixGitHubManager = require('lib/MendixGitHubManager'),
MendixWorkshopManager = require('lib/MendixWorkshopManager'),
MendixCodeManager = require('lib/MendixCodeManager'),
MendixWorkspaceManager = require('lib/MendixWorkspaceManager');
if (typeof ExtensionManager.extensions['mendix.uxforbrackets'] === 'undefined') {
// Only load the external libraries
JSBeautify = require('extension/beautify/main');
CodeFolding = require('extension/codefolding/main');
JSIndentator = require('extension/brackets-indentator/main');
}
// Load CSS
AppInit.htmlReady(function () {
// Load fonts and then set the rest!
ExtensionUtils.loadStyleSheet(module, './css/font-awesome.min.css').done(function (index) {
// Load CSS and then set the rest!
ExtensionUtils.loadStyleSheet(module, './css/main.css').done(function (index) {
// Load CSS and then set the rest!
ExtensionUtils.loadStyleSheet(module, './extension/toastr/toastr.min.css').done(function (index) {
// Create the panel.
MendixWorkspaceManager.createPanel();
/**
* Mendix Workshop Manager functions.
*/
MendixWorkshopManager.panel = MendixWorkspaceManager.panel;
// Execute workshop manager setup menu.
MendixWorkshopManager.setupMenu();
// Create the workshop snippets.
MendixWorkshopManager.setupSnippets();
/**
* Mendix Workspace Manager.
*/
// Handle panel resizing.
MendixWorkspaceManager.panelResizer();
MendixWorkspaceManager.panelNavigation();
// Add the mendix logo at the back of the Brackets
MendixWorkspaceManager.alterNoFilePanel();
/**
* Mendix Code Manager.
*/
// Create code manager!
MendixCodeManager.createSidePanel();
MendixCodeManager.setupEvents();
/**
* Mendix GitHub Manager!
*/
MendixGitHubManager.setupMenu();
});
});
});
});
});