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

updating extension to call Brackets' new Preference APIs #169

Merged
merged 4 commits into from
Apr 7, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ define(function (require, exports, module) {
// Local variables
var lastFontSelected = null;
var lastTwentyFonts = [];
var prefs = {};
var prefs;
var whitespaceRegExp = /\s/;
var commaSemiRegExp = /([;,])/;
var fontnameStartRegExp = /[\w"',]/;
Expand Down Expand Up @@ -218,7 +218,8 @@ define(function (require, exports, module) {
if (lastTwentyFonts.length > 20) {
lastTwentyFonts.splice(20, lastTwentyFonts.length - 20);
}
prefs.setValue(PREFERENCES_FONT_HISTORY_KEY, lastTwentyFonts);
prefs.set(PREFERENCES_FONT_HISTORY_KEY, lastTwentyFonts);
prefs.save();
}

function _showHowtoDialog() {
Expand Down Expand Up @@ -523,8 +524,9 @@ define(function (require, exports, module) {
});

// setup preferences
prefs = PreferencesManager.getPreferenceStorage(PREFERENCES_CLIENT_ID);
lastTwentyFonts = prefs.getValue(PREFERENCES_FONT_HISTORY_KEY);
prefs = PreferencesManager.getExtensionPrefs("edgewebfonts");
PreferencesManager.convertPreferences("com.adobe.edgewebfonts", { "ewf-font-history": "user edgewebfonts.ewf-font-history" });
lastTwentyFonts = prefs.get(PREFERENCES_FONT_HISTORY_KEY);
if (!lastTwentyFonts) {
lastTwentyFonts = [];
}
Expand Down