-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
22 lines (22 loc) · 921 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
define(function (require, exports, module) {
"use strict";
var Menus = brackets.getModule("command/Menus"),
CommandManager = brackets.getModule("command/CommandManager"),
EditorManager = brackets.getModule("editor/EditorManager");
/*
* Adds a menuitem, gives it an id, triggers a function when menuitem is pressed.
*/
CommandManager.register("Generate HTML-Skeleton", "gustav-malm.brackets-template-generator.generateHTML", getHTMLTemplate);
/*
* Creates a custom menu.
*/
var menu = Menus.addMenu("Templates", "gustav-malm.brackets.menu");
menu.addMenuItem("gustav-malm.brackets-template-generator.generateHTML", "Ctrl-Alt-Shift-H");
/*
* A function which uses "require" to load a HTML-Template.
*/
function getHTMLTemplate() {
var template = require('text!assets/templates/template.html');
EditorManager.getCurrentFullEditor()._codeMirror.setValue(template);
}
});