-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
arknu
committed
Mar 1, 2015
1 parent
a7fdf44
commit 76463d1
Showing
72 changed files
with
3,070 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations.Editor.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion> | ||
</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{67EDA72B-2BA7-497F-BD4E-DCD508D535BF}</ProjectGuid> | ||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Arknu.Umbraco.Relations.Editor</RootNamespace> | ||
<AssemblyName>Arknu.Umbraco.Relations.Editor</AssemblyName> | ||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | ||
<UseIISExpress>true</UseIISExpress> | ||
<IISExpressSSLPort /> | ||
<IISExpressAnonymousAuthentication /> | ||
<IISExpressWindowsAuthentication /> | ||
<IISExpressUseClassicPipelineMode /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Web.DynamicData" /> | ||
<Reference Include="System.Web.Entity" /> | ||
<Reference Include="System.Web.ApplicationServices" /> | ||
<Reference Include="System.ComponentModel.DataAnnotations" /> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="System.Web.Extensions" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Drawing" /> | ||
<Reference Include="System.Web" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="System.Configuration" /> | ||
<Reference Include="System.Web.Services" /> | ||
<Reference Include="System.EnterpriseServices" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="Arknu.Umbraco.Relations\arknu.umbraco.relations.controller.js" /> | ||
<Content Include="Arknu.Umbraco.Relations\arknu.umbraco.relations.resource.js" /> | ||
<None Include="Arknu.Umbraco.Relations\package.manifest" /> | ||
<Content Include="Arknu.Umbraco.Relations\arknu.umbraco.relations.config.html" /> | ||
<None Include="Web.Debug.config"> | ||
<DependentUpon>Web.config</DependentUpon> | ||
</None> | ||
<None Include="Web.Release.config"> | ||
<DependentUpon>Web.config</DependentUpon> | ||
</None> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="Arknu.Umbraco.Relations\arknu.umbraco.relations.config.controller.js" /> | ||
<Content Include="Arknu.Umbraco.Relations\arknu.umbraco.relations.html" /> | ||
<Content Include="Web.config" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> | ||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> | ||
</PropertyGroup> | ||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | ||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" /> | ||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" /> | ||
<ProjectExtensions> | ||
<VisualStudio> | ||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> | ||
<WebProjectProperties> | ||
<UseIIS>True</UseIIS> | ||
<AutoAssignPort>True</AutoAssignPort> | ||
<DevelopmentServerPort>51933</DevelopmentServerPort> | ||
<DevelopmentServerVPath>/</DevelopmentServerVPath> | ||
<IISUrl>http://localhost:51933/</IISUrl> | ||
<NTLMAuthentication>False</NTLMAuthentication> | ||
<UseCustomServer>False</UseCustomServer> | ||
<CustomServerUrl> | ||
</CustomServerUrl> | ||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> | ||
</WebProjectProperties> | ||
</FlavorProperties> | ||
</VisualStudio> | ||
</ProjectExtensions> | ||
<PropertyGroup> | ||
<PostBuildEvent>xcopy "$(ProjectDir)Arknu.Umbraco.Relations\*" "$(SolutionDir)\Arknu.Umbraco.Relations.Web\App_Plugins\Arknu.Umbraco.Relations\" /E /Y</PostBuildEvent> | ||
</PropertyGroup> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
7 changes: 7 additions & 0 deletions
7
...aco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
angular.module("umbraco") | ||
.controller("Arknu.Umbraco.Relations.Config.Controller", function ($scope, arknuRelationsResource, editorState) { | ||
$scope.model.relationTypes = []; | ||
arknuRelationsResource.getRelationTypes(editorState.current.id).then(function (response) { | ||
$scope.model.relationTypes = response.data; | ||
}); | ||
}); |
4 changes: 4 additions & 0 deletions
4
Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<div ng-controller="Arknu.Umbraco.Relations.Config.Controller"> | ||
<select ng-model="model.value" | ||
ng-options="r.Alias as r.Name for r in model.relationTypes"></select> | ||
</div> |
48 changes: 48 additions & 0 deletions
48
Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
angular.module("umbraco") | ||
.controller("Arknu.Umbraco.Relations.Controller", function ($scope, arknuRelationsResource, editorState, dialogService) { | ||
var type = $scope.model.config.relationTypeAlias; | ||
|
||
arknuRelationsResource.getRelations(editorState.current.id, type).then(function (response) { | ||
$scope.model.items = response.data; | ||
}); | ||
|
||
var dialogOptions = { | ||
multiPicker: true, | ||
entityType: "content", | ||
filterCssClass: "not-allowed not-published", | ||
startNodeId: null, | ||
callback: function (data) { | ||
if (angular.isArray(data)) { | ||
_.each(data, function (item, i) { | ||
$scope.add(item); | ||
}); | ||
} else { | ||
$scope.clear(); | ||
$scope.add(data); | ||
} | ||
}, | ||
treeAlias: "content", | ||
section: "content" | ||
}; | ||
|
||
//dialog | ||
$scope.openContentPicker = function () { | ||
var d = dialogService.treePicker(dialogOptions); | ||
}; | ||
|
||
$scope.remove = function (index) { | ||
var item = $scope.model.items[index]; | ||
arknuRelationsResource.deleteRelation(item.relationId).then(function (response) { | ||
$scope.model.items.splice(index, 1); | ||
}); | ||
|
||
}; | ||
|
||
$scope.add = function (item) { | ||
arknuRelationsResource.saveRelation(editorState.current.id, item.id, type).then(function (response) { | ||
$scope.model.items.push(response.data); | ||
}); | ||
|
||
|
||
}; | ||
}); |
25 changes: 25 additions & 0 deletions
25
Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div ng-controller="Arknu.Umbraco.Relations.Controller" class="umb-editor umb-contentpicker"> | ||
<ul class="unstyled list-icons" | ||
ng-model="model.items"> | ||
|
||
<li ng-repeat="node in model.items"> | ||
|
||
<i class="icon icon-navigation handle"></i> | ||
|
||
<a href="#" prevent-default ng-click="remove($index)"> | ||
<i class="icon icon-delete red hover-show"></i> | ||
<i class="{{node.icon}} hover-hide"></i> | ||
{{node.name}} | ||
</a> | ||
</li> | ||
</ul> | ||
|
||
<ul class="unstyled list-icons"> | ||
<li> | ||
<i class="icon icon-add blue"></i> | ||
<a href="#" ng-click="openContentPicker()" prevent-default> | ||
<localize key="general_add">Add</localize> | ||
</a> | ||
</li> | ||
</ul> | ||
</div> |
24 changes: 24 additions & 0 deletions
24
Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/arknu.umbraco.relations.resource.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
angular.module('umbraco.resources').factory('arknuRelationsResource', | ||
function ($q, $http) { | ||
//the factory object returned | ||
return { | ||
//this cals the Api Controller we setup earlier | ||
getRelations: function (id, type) { | ||
var baseurl = Umbraco.Sys.ServerVariables.arknuRelations.relationsApiBase; | ||
return $http.get(baseurl + "GetRelations/" + id + "?type=" + type); | ||
}, | ||
getRelationTypes: function (id) { | ||
var baseurl = Umbraco.Sys.ServerVariables.arknuRelations.relationsApiBase; | ||
return $http.get(baseurl + "GetRelationTypes"); | ||
}, | ||
saveRelation: function (sourceid, targetid, type) { | ||
var baseurl = Umbraco.Sys.ServerVariables.arknuRelations.relationsApiBase; | ||
return $http.post(baseurl + "SaveRelation?sourceid=" + sourceid + "&targetid=" + targetid + "&type=" + type); | ||
}, | ||
deleteRelation: function (relationid) { | ||
var baseurl = Umbraco.Sys.ServerVariables.arknuRelations.relationsApiBase; | ||
return $http.delete(baseurl + "DeleteRelation?relationid=" + relationid); | ||
} | ||
}; | ||
} | ||
); |
33 changes: 33 additions & 0 deletions
33
Arknu.Umbraco.Relations.Editor/Arknu.Umbraco.Relations/package.manifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
//you can define multiple editors | ||
propertyEditors: [ | ||
{ | ||
alias: "Arknu.Umbraco.Relations", | ||
name: "Relations Picker", | ||
editor: { | ||
view: "~/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.html" | ||
}, | ||
prevalues: { | ||
fields: [ | ||
{ | ||
label: "Relation type", | ||
description: "Select the relation type to use", | ||
key: "relationTypeAlias", | ||
view: "~/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.html" | ||
|
||
} | ||
] | ||
} | ||
|
||
} | ||
] | ||
, | ||
//array of files we want to inject into the application on app_start | ||
javascript: [ | ||
"~/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.controller.js", | ||
"~/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.config.controller.js", | ||
"~/App_Plugins/Arknu.Umbraco.Relations/arknu.umbraco.relations.resource.js" | ||
], | ||
css: [ | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("Arknu.Umbraco.Relations.Editor")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("Arknu.Umbraco.Relations.Editor")] | ||
[assembly: AssemblyCopyright("Copyright © 2015")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("65754a0d-bd49-4597-b7ff-f6ef6fb68abc")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Revision and Build Numbers | ||
// by using the '*' as shown below: | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 --> | ||
|
||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> | ||
<!-- | ||
In the example below, the "SetAttributes" transform will change the value of | ||
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator | ||
finds an attribute "name" that has a value of "MyDB". | ||
<connectionStrings> | ||
<add name="MyDB" | ||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" | ||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/> | ||
</connectionStrings> | ||
--> | ||
<system.web> | ||
<!-- | ||
In the example below, the "Replace" transform will replace the entire | ||
<customErrors> section of your web.config file. | ||
Note that because there is only one customErrors section under the | ||
<system.web> node, there is no need to use the "xdt:Locator" attribute. | ||
<customErrors defaultRedirect="GenericError.htm" | ||
mode="RemoteOnly" xdt:Transform="Replace"> | ||
<error statusCode="500" redirect="InternalError.htm"/> | ||
</customErrors> | ||
--> | ||
</system.web> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 --> | ||
|
||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> | ||
<!-- | ||
In the example below, the "SetAttributes" transform will change the value of | ||
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator | ||
finds an attribute "name" that has a value of "MyDB". | ||
<connectionStrings> | ||
<add name="MyDB" | ||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" | ||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/> | ||
</connectionStrings> | ||
--> | ||
<system.web> | ||
<compilation xdt:Transform="RemoveAttributes(debug)" /> | ||
<!-- | ||
In the example below, the "Replace" transform will replace the entire | ||
<customErrors> section of your web.config file. | ||
Note that because there is only one customErrors section under the | ||
<system.web> node, there is no need to use the "xdt:Locator" attribute. | ||
<customErrors defaultRedirect="GenericError.htm" | ||
mode="RemoteOnly" xdt:Transform="Replace"> | ||
<error statusCode="500" redirect="InternalError.htm"/> | ||
</customErrors> | ||
--> | ||
</system.web> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
For more information on how to configure your ASP.NET application, please visit | ||
http://go.microsoft.com/fwlink/?LinkId=169433 | ||
--> | ||
<configuration> | ||
<system.web> | ||
<compilation debug="true" targetFramework="4.5" /> | ||
<httpRuntime targetFramework="4.5" /> | ||
</system.web> | ||
</configuration> |
Oops, something went wrong.