From 13afb127f476083f0bfa3aefafd5a25962a99723 Mon Sep 17 00:00:00 2001 From: perploug Date: Fri, 23 Aug 2013 14:19:16 +0200 Subject: [PATCH] Whoops, broke build, now fixed --- .../markdowneditor.controller.js | 27 +++++++++++++++++-- .../Editors/AuthenticationController.cs | 16 ----------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/Umbraco.Web.UI/App_Plugins/MarkdownEditor/markdowneditor.controller.js b/src/Umbraco.Web.UI/App_Plugins/MarkdownEditor/markdowneditor.controller.js index f4bdf66e7b..fb47b80926 100644 --- a/src/Umbraco.Web.UI/App_Plugins/MarkdownEditor/markdowneditor.controller.js +++ b/src/Umbraco.Web.UI/App_Plugins/MarkdownEditor/markdowneditor.controller.js @@ -1,7 +1,7 @@ angular.module("umbraco") .controller("My.MarkdownEditorController", -//inject umbracos assetsServce -function ($scope,assetsService) { +//inject umbracos assetsServce and dialog service +function ($scope,assetsService, dialogService) { //tell the assets service to load the markdown.editor libs from the markdown editors //plugin folder @@ -21,6 +21,29 @@ function ($scope,assetsService) { var converter2 = new Markdown.Converter(); var editor2 = new Markdown.Editor(converter2, "-" + $scope.model.alias); editor2.run(); + + //subscribe to the image dialog clicks + editor2.hooks.set("insertImageDialog", function (callback) { + alert("Please click okay to start scanning your brain..."); + + dialogService.mediaPicker({callback: function(data){ + $(data.selection).each(function(i, item){ + alert(item); + }); + }}); + +/* + setTimeout(function () { + var prompt = "We have detected that you like cats. Do you want to insert an image of a cat?"; + if (confirm(prompt)) + callback("http://icanhascheezburger.files.wordpress.com/2007/06/schrodingers-lolcat1.jpg") + else + callback(null); + }, 2000); +*/ + + return true; // tell the editor that we'll take care of getting the image url + }); }); //load the seperat css for the editor to avoid it blocking our js loading TEMP HACK diff --git a/src/Umbraco.Web/Editors/AuthenticationController.cs b/src/Umbraco.Web/Editors/AuthenticationController.cs index d3eb2a5d77..8a516e9c0f 100644 --- a/src/Umbraco.Web/Editors/AuthenticationController.cs +++ b/src/Umbraco.Web/Editors/AuthenticationController.cs @@ -59,22 +59,6 @@ namespace Umbraco.Web.Editors throw new HttpResponseException(HttpStatusCode.Unauthorized); } - /// - /// Returns all users - /// - /// - public UserDetail GetCurrentUser() - { - var attempt = UmbracoContext.Security.AuthorizeRequest(); - if (attempt == ValidateRequestAttempt.Success) - { - var user = Services.UserService.GetUserById(UmbracoContext.Security.GetUserId()); - return _userModelMapper.ToUserDetail(user); - } - - //return Unauthorized (401) because the user is not authorized right now - throw new HttpResponseException(HttpStatusCode.Unauthorized); - } /// /// Logs a user in