Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.

Fix urls by converting virtual paths to absolute #63

Merged
merged 1 commit into from
Feb 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
function ($q, $http, umbRequestHelper) {
return {
getContentTypeAliasByGuid: function (guid) {
var url = "/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetContentTypeAliasByGuid?guid=" + guid;
var url = umbRequestHelper.convertVirtualToAbsolutePath("~/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetContentTypeAliasByGuid?guid=" + guid);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0Neji Sorry to sound picky, any chance you can correct the whitespacing - tab to spaces? Thanks.

return umbRequestHelper.resourcePromise(
$http.get(url),
'Failed to retrieve content type alias by guid'
);
},
getContentTypes: function (allowedContentTypes) {
var url = "/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetContentTypes";
var url = umbRequestHelper.convertVirtualToAbsolutePath("~/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetContentTypes");
if (allowedContentTypes) {
for (var i = 0; i < allowedContentTypes.length; i++) {
url += (i == 0 ? "?" : "&") + "allowedContentTypes=" + allowedContentTypes[i];
Expand All @@ -21,21 +21,21 @@
);
},
getContentTypeIcon: function (contentTypeAlias) {
var url = "/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetContentTypeIcon?contentTypeAlias=" + contentTypeAlias;
var url = umbRequestHelper.convertVirtualToAbsolutePath("~/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetContentTypeIcon?contentTypeAlias=" + contentTypeAlias);
return umbRequestHelper.resourcePromise(
$http.get(url),
'Failed to retrieve content type icon'
);
},
getDataTypePreValues: function (dtdId) {
var url = "/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetDataTypePreValues?dtdid=" + dtdId;
var url = umbRequestHelper.convertVirtualToAbsolutePath("~/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetDataTypePreValues?dtdid=" + dtdId);
return umbRequestHelper.resourcePromise(
$http.get(url),
'Failed to retrieve datatypes'
);
},
getEditorMarkupForDocTypePartial: function (nodeId, id, editorAlias, contentTypeAlias, value, viewPath, previewViewPath, published) {
var url = "/" + (published ? nodeId : "") + "?dtgePreview=1" + (published ? "" : "&nodeId=" + nodeId);
var url = umbRequestHelper.convertVirtualToAbsolutePath("~/" + (published ? nodeId : "") + "?dtgePreview=1" + (published ? "" : "&nodeId=" + nodeId));
return $http({
method: 'POST',
url: url,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
angular.module('umbraco.services').factory('Our.Umbraco.DocTypeGridEditor.Services.DocTypeDialogService',
function (dialogService, editorState) {
function (dialogService, editorState, umbRequestHelper) {
return {
open: function (options) {

var o = $.extend({}, {
template: "/App_Plugins/DocTypeGridEditor/Views/doctypegrideditor.dialog.html",
template: umbRequestHelper.convertVirtualToAbsolutePath("~/App_Plugins/DocTypeGridEditor/Views/doctypegrideditor.dialog.html"),
show: true,
requireName: true,
}, options);
Expand Down