This repository has been archived by the owner on Oct 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
49 lines (44 loc) · 1.54 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
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */
/*global define, $, brackets, window */
define(function (require, exports, module) {
"use strict";
// Brackets modules
var PreferencesManager = brackets.getModule('preferences/PreferencesManager'),
KOMenu = require("KOMenu"),
KOQuickEdit = require("KOQuickEdit"),
KOCodeHints = require("KOCodeHints");
/**
* Get preferences.
*/
var koJsPreferences = PreferencesManager.getExtensionPrefs("ericsmekens.knockoutjs");
var showKOIcon = koJsPreferences.get('show_icon');
if (showKOIcon === undefined) {
showKOIcon = true;
koJsPreferences.set('show_icon', true);
koJsPreferences.save();
}
var useKOCodeHint = koJsPreferences.get('code_hint');
if (useKOCodeHint === undefined) {
useKOCodeHint = true;
koJsPreferences.set('code_hint', true);
koJsPreferences.save();
}
var useKOQuickEdit = koJsPreferences.get('quick_edit');
if (useKOQuickEdit === undefined) {
useKOQuickEdit = true;
koJsPreferences.set('quick_edit', true);
koJsPreferences.save();
}
// Adding menu/side-icon
if (showKOIcon) {
KOMenu.initKOMenu();
}
//Register CodeHinter for data-bind in html.
if (useKOCodeHint) {
KOCodeHints.initKOCodeHinter();
}
//Register quick-edit for ko.computeds.
if (useKOQuickEdit) {
KOQuickEdit.initKOQuickEdit();
}
});