-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathPreferences.js
More file actions
40 lines (36 loc) · 1.49 KB
/
Preferences.js
File metadata and controls
40 lines (36 loc) · 1.49 KB
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
/**
* Manages preferences for custom regions.
* @author Patrick Oladimeji
* @date 16/08/2015 10:23 AM
*/
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */
/*global define, brackets*/
define(function (require, exports, module) {
"use strict";
var PreferencesManager = brackets.getModule("preferences/PreferencesManager"),
prefs = PreferencesManager.getExtensionPrefs("custom-region-fold"),
strings = require("strings");
//define default preference values if they have not yet been defined
prefs.definePreference("startRegionWord", "string", "region",
{name: strings.START_REGION_WORD, description: strings.START_REGION_WORD_DESC});
prefs.definePreference("endRegionWord", "string", "endregion",
{name: strings.END_REGION_WORD, description: strings.END_REGION_WORD_DESC});
/**
* Get the setting with the specified key
* @param {!string} key The key for the setting to retrieve
* @return {string} the setting with the specified key
*/
function get(key) {
return prefs.get(key);
}
/**
Set the setting attributed to the given key using the value supplied
@param {!string} key the key for the setting to set
@param {object} value the new value for the object
*/
function set(key, value) {
prefs.set(key, value);
}
exports.get = get;
exports.set = set;
});