Fixes up the content editor js, updates some docs to reflect correct naming conventions.
This commit is contained in:
@@ -30,10 +30,10 @@ create and modify data.
|
||||
|
||||
##Setting up a plugin
|
||||
|
||||
The first thing we must do is create a new folder inside `/app_plugins` folder. We will call it
|
||||
The first thing we must do is create a new folder inside `/App_Plugins` folder. We will call it
|
||||
`MarkDownEditor`
|
||||
|
||||
Next We will create a simple manifest file to describe what this plugin does. This manifest will tell Umbraco about our new property editor and allows us to inject any needed files into the application, so we create the file `/app_plugins/MarkDownEditor/package.manifest`
|
||||
Next We will create a simple manifest file to describe what this plugin does. This manifest will tell Umbraco about our new property editor and allows us to inject any needed files into the application, so we create the file `/App_Plugins/MarkDownEditor/package.manifest`
|
||||
|
||||
Inside this package manifest we add a bit of json to describe the property editor, have a look at the inline comments in the json below for details on each bit:
|
||||
|
||||
@@ -111,9 +111,9 @@ Then open the `markdowneditor.controller.js` file and edit it so it looks like t
|
||||
//plugin folder
|
||||
assetsService
|
||||
.load([
|
||||
"/app_plugins/markdowneditor/lib/markdown.converter.js",
|
||||
"/app_plugins/markdowneditor/lib/markdown.sanitizer.js",
|
||||
"/app_plugins/markdowneditor/lib/markdown.editor.js"
|
||||
"/App_Plugins/MarkDownEditor/lib/markdown.converter.js",
|
||||
"/App_Plugins/MarkDownEditor/lib/markdown.sanitizer.js",
|
||||
"/App_Plugins/MarkDownEditor/lib/markdown.editor.js"
|
||||
])
|
||||
.then(function () {
|
||||
//this function will execute when all dependencies have loaded
|
||||
@@ -121,7 +121,7 @@ Then open the `markdowneditor.controller.js` file and edit it so it looks like t
|
||||
});
|
||||
|
||||
//load the seperat css for the editor to avoid it blocking our js loading
|
||||
assetsService.loadCss("/app_plugins/markdowneditor/lib/markdown.css");
|
||||
assetsService.loadCss("/App_Plugins/MarkDownEditor/lib/markdown.css");
|
||||
});
|
||||
|
||||
This loads in our external dependency, but only when its needed by the editor.
|
||||
|
||||
@@ -52,22 +52,16 @@ function ContentEditController($scope, $routeParams, $location, contentResource,
|
||||
contentEditingHelper.handleSuccessfulSave({
|
||||
scope: $scope,
|
||||
newContent: data,
|
||||
rebindCallback: contentEditingHelper.reBindChangedProperties(
|
||||
contentEditingHelper.getAllProps($scope.content),
|
||||
contentEditingHelper.getAllProps(data))
|
||||
rebindCallback: contentEditingHelper.reBindChangedProperties($scope.content, data)
|
||||
});
|
||||
|
||||
}, function (err) {
|
||||
|
||||
var allNewProps = contentEditingHelper.getAllProps(err.data);
|
||||
var allOrigProps = contentEditingHelper.getAllProps($scope.content);
|
||||
|
||||
contentEditingHelper.handleSaveError({
|
||||
err: err,
|
||||
redirectOnFailure: true,
|
||||
allNewProps: allNewProps,
|
||||
allOrigProps: contentEditingHelper.getAllProps($scope.content),
|
||||
rebindCallback: contentEditingHelper.reBindChangedProperties(allOrigProps, allNewProps)
|
||||
allNewProps: contentEditingHelper.getAllProps(err.data),
|
||||
rebindCallback: contentEditingHelper.reBindChangedProperties($scope.content, err.data)
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
id: "0BA0F832-D759-4526-9B3E-94BBFC98F92E",
|
||||
name: "Regex",
|
||||
defaultConfig: {
|
||||
regexStatement: "^\\d*$"
|
||||
regex: "^\\d*$"
|
||||
},
|
||||
editor: {
|
||||
view: "~/App_Plugins/MyPackage/PropertyEditors/Views/RegexEditor.html",
|
||||
|
||||
Reference in New Issue
Block a user