2013-07-12 11:36:22 +02:00
|
|
|
angular.module("umbraco")
|
|
|
|
|
.controller("My.MarkdownEditorController",
|
2013-08-05 13:04:24 +02:00
|
|
|
//inject umbracos assetsServce
|
|
|
|
|
function ($scope,assetsService) {
|
2013-07-12 11:36:22 +02:00
|
|
|
|
2013-08-05 13:04:24 +02:00
|
|
|
//tell the assets service to load the markdown.editor libs from the markdown editors
|
2013-07-12 11:36:22 +02:00
|
|
|
//plugin folder
|
2013-08-05 13:04:24 +02:00
|
|
|
assetsService
|
2013-07-12 11:36:22 +02:00
|
|
|
.load([
|
|
|
|
|
"/app_plugins/markdowneditor/lib/markdown.converter.js",
|
|
|
|
|
"/app_plugins/markdowneditor/lib/markdown.sanitizer.js",
|
|
|
|
|
"/app_plugins/markdowneditor/lib/markdown.editor.js"
|
|
|
|
|
])
|
|
|
|
|
.then(function () {
|
2013-08-05 13:04:24 +02:00
|
|
|
//this function will execute when all dependencies have loaded
|
|
|
|
|
var converter2 = new Markdown.Converter();
|
|
|
|
|
var editor2 = new Markdown.Editor(converter2, "-" + $scope.model.alias);
|
2013-07-12 11:36:22 +02:00
|
|
|
editor2.run();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//load the seperat css for the editor to avoid it blocking our js loading TEMP HACK
|
2013-08-05 13:04:24 +02:00
|
|
|
assetsService.loadCss("/app_plugins/markdowneditor/lib/markdown.css");
|
2013-07-12 11:36:22 +02:00
|
|
|
});
|