This repository has been archived by the owner on Sep 4, 2023. It is now read-only.
forked from adobe/aem-brackets-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
65 lines (61 loc) · 2.77 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
/*******************************************************************************
* Copyright (c) 2014 Adobe Systems Incorporated. All rights reserved.
*
* Licensed under the Apache License 2.0.
* http://www.apache.org/licenses/LICENSE-2.0
******************************************************************************/
/*global define, $, brackets, require */
require.config({
paths: {
'text' : 'lib/text',
'i18n' : 'lib/i18n'
},
locale: brackets.getLocale()
});
define(function (require, exports, module) {
'use strict';
// Load submodules
var Menu = require('sly/menu/Menu'),
SightlyLanguage = require('sly/SightlyLanguage'),
BeanManager = require('sly/BeanManager'),
SlyCodeHints = require('sly/SightlyCodeHint'),
Highlighter = require('sly/Highlighter'),
RemoteSyncMgr = require('sly/RemoteSyncManager'),
ToolBar = require('sly/toolbar/ToolBar'),
Preferences = require('sly/preferences/Preferences'),
SLYDefault = require('text!sly/bootstrap/default.json'),
SLYCQ = require('text!sly/bootstrap/extensions/cq.json'),
SLYSling = require('text!sly/bootstrap/extensions/sling.json'),
defaultJSON = JSON.parse(SLYDefault),
cqJSON = JSON.parse(SLYCQ),
slingJSON = JSON.parse(SLYSling),
SLYDictionary = $.extend(true, defaultJSON, cqJSON, slingJSON),
AppInit = brackets.getModule('utils/AppInit'),
ExtensionUtils = brackets.getModule('utils/ExtensionUtils');
AppInit.appReady(function () {
try {
Menu.load(SLYDictionary);
Preferences.load(SLYDictionary);
RemoteSyncMgr.load(SLYDictionary);
SightlyLanguage.load(SLYDictionary);
Highlighter.load(SLYDictionary);
BeanManager.load(SLYDictionary);
SlyCodeHints.load(SLYDictionary);
ToolBar.load(SLYDictionary);
brackets.getModule(
['file/FilePathProcessor'],
function (fpp) {
var CRXDEFilePathProcessor = require('sly/CRXDEFilePathProcessor').CRXDEFilePathProcessor;
brackets.app.registerFilePathProcessor(new CRXDEFilePathProcessor());
},
function (err) {
var failed = err.requireModules && err.requireModules[0];
console.log('Cannot load module ' + failed);
}
);
ExtensionUtils.loadStyleSheet(module, 'sly/styles/sly.css').done();
} catch (e) {
console.error('unable to correctly load sightly extension : ' + e);
}
});
});