forked from brackets-userland/brackets-git
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChangelogDialog.js
More file actions
34 lines (27 loc) · 1.46 KB
/
ChangelogDialog.js
File metadata and controls
34 lines (27 loc) · 1.46 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
/*jslint plusplus: true, vars: true, nomen: true */
/*global $, brackets, define, Mustache */
define(function (require, exports) {
"use strict";
var Dialogs = brackets.getModule("widgets/Dialogs"),
FileSystem = brackets.getModule("filesystem/FileSystem"),
FileUtils = brackets.getModule("file/FileUtils"),
StringUtils = brackets.getModule("utils/StringUtils"),
Preferences = require("./Preferences"),
Strings = require("../strings"),
changelogDialogTemplate = require("text!htmlContent/git-changelog-dialog.html");
var marked = require("../thirdparty/marked");
var dialog;
exports.show = function () {
Strings.EXTENSION_VERSION = Preferences.get("lastVersion");
var title = StringUtils.format(Strings.EXTENSION_WAS_UPDATED_TITLE, Strings.EXTENSION_VERSION);
var compiledTemplate = Mustache.render(changelogDialogTemplate, {Strings: Strings, TITLE: title});
dialog = Dialogs.showModalDialogUsingTemplate(compiledTemplate);
FileUtils.readAsText(FileSystem.getFileForPath(Preferences.get("extensionDirectory") + "CHANGELOG.md")).done(function (content) {
content = marked(content, {
gfm: true,
breaks: true
});
$("#git-changelog", dialog.getElement()).html(content);
});
};
});