Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit b7726b5

Browse files
committed
Merge pull request #169 from adobe/bchin/update-to-new-Preferences-API
updating extension to call Brackets' new Preference APIs
2 parents f2f290d + f1e4f36 commit b7726b5

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

main.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ define(function (require, exports, module) {
6969
// Local variables
7070
var lastFontSelected = null;
7171
var lastTwentyFonts = [];
72-
var prefs = {};
72+
var prefs;
7373
var whitespaceRegExp = /\s/;
7474
var commaSemiRegExp = /([;,])/;
7575
var fontnameStartRegExp = /[\w"',]/;
@@ -218,7 +218,8 @@ define(function (require, exports, module) {
218218
if (lastTwentyFonts.length > 20) {
219219
lastTwentyFonts.splice(20, lastTwentyFonts.length - 20);
220220
}
221-
prefs.setValue(PREFERENCES_FONT_HISTORY_KEY, lastTwentyFonts);
221+
prefs.set(PREFERENCES_FONT_HISTORY_KEY, lastTwentyFonts);
222+
prefs.save();
222223
}
223224

224225
function _showHowtoDialog() {
@@ -523,8 +524,9 @@ define(function (require, exports, module) {
523524
});
524525

525526
// setup preferences
526-
prefs = PreferencesManager.getPreferenceStorage(PREFERENCES_CLIENT_ID);
527-
lastTwentyFonts = prefs.getValue(PREFERENCES_FONT_HISTORY_KEY);
527+
prefs = PreferencesManager.getExtensionPrefs("edgewebfonts");
528+
PreferencesManager.convertPreferences("com.adobe.edgewebfonts", { "ewf-font-history": "user edgewebfonts.ewf-font-history" });
529+
lastTwentyFonts = prefs.get(PREFERENCES_FONT_HISTORY_KEY);
528530
if (!lastTwentyFonts) {
529531
lastTwentyFonts = [];
530532
}

0 commit comments

Comments
 (0)