Merge remote-tracking branch 'origin/dev-v7' into temp-U4-7748

This commit is contained in:
Shannon
2016-01-19 14:48:36 +01:00
10 changed files with 50 additions and 24 deletions

View File

@@ -5,7 +5,7 @@
* @description A helper service for most editors, some methods are specific to content/media/member model types but most are used by
* all editors to share logic and reduce the amount of replicated code among editors.
**/
function contentEditingHelper(fileManager, $q, $location, $routeParams, notificationsService, serverValidationManager, dialogService, formHelper, appState, keyboardService) {
function contentEditingHelper(fileManager, $q, $location, $routeParams, notificationsService, serverValidationManager, dialogService, formHelper, appState) {
function isValidIdentifier(id){
//empty id <= 0
@@ -128,8 +128,6 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica
switch (ch) {
case "U":
//publish action
keyboardService.bind("ctrl+p", args.methods.saveAndPublish);
return {
letter: ch,
labelKey: "buttons_saveAndPublish",
@@ -138,8 +136,6 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica
};
case "H":
//send to publish
keyboardService.bind("ctrl+p", args.methods.sendToPublish);
return {
letter: ch,
labelKey: "buttons_saveToPublish",
@@ -148,7 +144,6 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica
};
case "A":
//save
keyboardService.bind("ctrl+s", args.methods.save);
return {
letter: ch,
labelKey: "buttons_save",
@@ -157,12 +152,11 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica
};
case "Z":
//unpublish
keyboardService.bind("ctrl+u", args.methods.unPublish);
return {
letter: ch,
labelKey: "content_unPublish",
handler: args.methods.unPublish
handler: args.methods.unPublish,
hotKey: "ctrl+u"
};
default:
return null;

View File

@@ -6,7 +6,8 @@
button-style="success"
state="state"
label="{{defaultButton.labelKey}}"
label-key="{{defaultButton.labelKey}}">
label-key="{{defaultButton.labelKey}}"
shortcut="{{defaultButton.hotKey}}">
</umb-button>
<a class="btn btn-success dropdown-toggle umb-button-group__toggle" data-toggle="dropdown" ng-if="subButtons.length > 0">
@@ -15,7 +16,7 @@
<ul aria-labelledby="dLabel" class="dropdown-menu bottom-up umb-button-group__sub-buttons" ng-if="subButtons.length > 0" role="menu" ng-class="{'-align-right': float === 'right'}">
<li ng-repeat="subButton in subButtons">
<a href="#" ng-click="subButton.handler()" prevent-default>
<a href="#" ng-click="subButton.handler()" hotkey="{{subButton.hotKey}}" prevent-default>
<localize key="{{subButton.labelKey}}">{{subButton.labelKey}}</localize>
</a>
</li>

View File

@@ -1,5 +1,5 @@
//inject umbracos assetsServce and dialog service
function MarkdownEditorController($scope, assetsService, dialogService, $timeout) {
function MarkdownEditorController($scope, $element, assetsService, dialogService, angularHelper, $timeout) {
//tell the assets service to load the markdown.editor libs from the markdown editors
//plugin folder
@@ -42,7 +42,7 @@ function MarkdownEditorController($scope, assetsService, dialogService, $timeout
// we need a short delay to wait for the textbox to appear.
setTimeout(function () {
//this function will execute when all dependencies have loaded
// but in the case that they've been previously loaded, we can only
// but in the case that they've been previously loaded, we can only
// init the md editor after this digest because the DOM needs to be ready first
// so run the init on a timeout
$timeout(function () {
@@ -56,6 +56,12 @@ function MarkdownEditorController($scope, assetsService, dialogService, $timeout
return true; // tell the editor that we'll take care of getting the image url
});
editor2.hooks.set("onPreviewRefresh", function () {
angularHelper.getCurrentForm($scope).$setDirty();
// We must manually update the model as there is no way to hook into the markdown editor events without editing that code.
$scope.model.value = $("textarea", $element).val();
});
}, 200);
});