Skip to content

Commit 8477e44

Browse files
committed
Support for Font-awesome v4
1 parent ee487ff commit 8477e44

5 files changed

+161
-8
lines changed

monosnow.umbraco.uCssClassNameDropdown.csproj

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
34
<PropertyGroup>
45
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
56
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -14,6 +15,15 @@
1415
<AssemblyName>monosnow.umbraco.uCssClassNameDropdown</AssemblyName>
1516
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
1617
<UseIISExpress>false</UseIISExpress>
18+
<FileUpgradeFlags>
19+
</FileUpgradeFlags>
20+
<UpgradeBackupLocation>
21+
</UpgradeBackupLocation>
22+
<OldToolsVersion>4.0</OldToolsVersion>
23+
<IISExpressSSLPort />
24+
<IISExpressAnonymousAuthentication />
25+
<IISExpressWindowsAuthentication />
26+
<IISExpressUseClassicPipelineMode />
1727
</PropertyGroup>
1828
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1929
<DebugSymbols>true</DebugSymbols>
@@ -35,15 +45,15 @@
3545
<ItemGroup>
3646
<Reference Include="businesslogic, Version=1.0.4779.24223, Culture=neutral, processorArchitecture=MSIL">
3747
<SpecificVersion>False</SpecificVersion>
38-
<HintPath>bin\businesslogic.dll</HintPath>
48+
<HintPath>CoreDlls\businesslogic.dll</HintPath>
3949
</Reference>
4050
<Reference Include="cms, Version=1.0.4779.24224, Culture=neutral, processorArchitecture=MSIL">
4151
<SpecificVersion>False</SpecificVersion>
42-
<HintPath>bin\cms.dll</HintPath>
52+
<HintPath>CoreDlls\cms.dll</HintPath>
4353
</Reference>
4454
<Reference Include="interfaces, Version=1.0.4779.24221, Culture=neutral, processorArchitecture=MSIL">
4555
<SpecificVersion>False</SpecificVersion>
46-
<HintPath>bin\interfaces.dll</HintPath>
56+
<HintPath>CoreDlls\interfaces.dll</HintPath>
4757
</Reference>
4858
<Reference Include="Microsoft.CSharp" />
4959
<Reference Include="System" />
@@ -64,11 +74,11 @@
6474
<Reference Include="System.Web.ApplicationServices" />
6575
<Reference Include="umbraco.DataLayer, Version=1.0.4779.24223, Culture=neutral, processorArchitecture=MSIL">
6676
<SpecificVersion>False</SpecificVersion>
67-
<HintPath>bin\umbraco.DataLayer.dll</HintPath>
77+
<HintPath>CoreDlls\umbraco.DataLayer.dll</HintPath>
6878
</Reference>
6979
<Reference Include="umbraco.editorControls, Version=1.0.4779.24227, Culture=neutral, processorArchitecture=MSIL">
7080
<SpecificVersion>False</SpecificVersion>
71-
<HintPath>bin\umbraco.editorControls.dll</HintPath>
81+
<HintPath>CoreDlls\umbraco.editorControls.dll</HintPath>
7282
</Reference>
7383
</ItemGroup>
7484
<ItemGroup>
@@ -90,6 +100,13 @@
90100
<Compile Include="usercontrols\BootstrapIconPicker.ascx.designer.cs">
91101
<DependentUpon>BootstrapIconPicker.ascx</DependentUpon>
92102
</Compile>
103+
<Compile Include="usercontrols\FontAwesomeV4IconPicker.ascx.cs">
104+
<DependentUpon>FontAwesomeV4IconPicker.ascx</DependentUpon>
105+
<SubType>ASPXCodeBehind</SubType>
106+
</Compile>
107+
<Compile Include="usercontrols\FontAwesomeV4IconPicker.ascx.designer.cs">
108+
<DependentUpon>FontAwesomeV4IconPicker.ascx</DependentUpon>
109+
</Compile>
93110
<Compile Include="usercontrols\FontAwesomeIconPicker.ascx.cs">
94111
<DependentUpon>FontAwesomeIconPicker.ascx</DependentUpon>
95112
<SubType>ASPXCodeBehind</SubType>
@@ -105,10 +122,16 @@
105122
<ItemGroup>
106123
<Content Include="test.aspx" />
107124
<Content Include="usercontrols\BootstrapIconPicker.ascx" />
125+
<Content Include="usercontrols\FontAwesomeV4IconPicker.ascx" />
108126
<Content Include="usercontrols\FontAwesomeIconPicker.ascx" />
109127
</ItemGroup>
128+
<PropertyGroup>
129+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
130+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
131+
</PropertyGroup>
110132
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
111-
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
133+
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
134+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
112135
<ProjectExtensions>
113136
<VisualStudio>
114137
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">

monosnow.umbraco.uCssClassNameDropdown.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
Microsoft Visual Studio Solution File, Format Version 11.00
3-
# Visual Studio 2010
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2012
44
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "monosnow.umbraco.uCssClassNameDropdown", "monosnow.umbraco.uCssClassNameDropdown.csproj", "{AB4A61F2-74B5-4903-8384-C6D4545EC7DB}"
55
EndProject
66
Global
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="FontAwesomeV4IconPicker.ascx.cs" Inherits="monosnow.umbraco.uCssClassNameDropdown.usercontrols.FontAwesomeV4IconPicker" %>
2+
<asp:ListView ID="lvIcons" runat="server" ItemPlaceholderID="itemPlaceHolder" GroupItemCount="4" GroupPlaceholderID="groupPlaceHolder">
3+
<LayoutTemplate>
4+
<div style="height:400px; width:650px;overflow:scroll">
5+
<asp:PlaceHolder ID="groupPlaceHolder" runat="server"></asp:PlaceHolder>
6+
</div>
7+
</LayoutTemplate>
8+
<GroupTemplate>
9+
<div style="clear:both"></div>
10+
<div>
11+
<asp:PlaceHolder ID="itemPlaceHolder" runat="server"></asp:PlaceHolder>
12+
</div>
13+
</GroupTemplate>
14+
<ItemTemplate>
15+
<a style="text-decoration:none; font-size:1.4em;color:#000000" href="#" onclick="setDropdownValue('<%#Container.DataItem %>');"><div style="width:150px;height:50px;float:left;"><i class="icon-<%#Container.DataItem %>"></i> <%#Container.DataItem %></div></a>
16+
</ItemTemplate>
17+
</asp:ListView>
18+
<asp:DropDownList ID="ddlIcons" runat="server"></asp:DropDownList>
19+
20+
<script type="text/javascript">
21+
function setDropdownValue(selectedValue) {
22+
document.getElementById("<%=ddlIcons.ClientID %>").value = selectedValue;
23+
}
24+
25+
26+
</script>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Web;
5+
using System.Web.UI;
6+
using System.Web.UI.WebControls;
7+
using monosnow.umbraco.uCssClassNameDropdown.Services;
8+
using System.Web.UI.HtmlControls;
9+
using umbraco.editorControls.userControlGrapper;
10+
11+
namespace monosnow.umbraco.uCssClassNameDropdown.usercontrols
12+
{
13+
public partial class FontAwesomeV4IconPicker : System.Web.UI.UserControl, IUsercontrolDataEditor
14+
{
15+
protected override void OnPreRender(EventArgs e)
16+
{
17+
bool linkIncluded = false;
18+
foreach (Control c in Page.Header.Controls)
19+
{
20+
if (c.ID == "FontAwesomeStylesheet")
21+
{
22+
linkIncluded = true;
23+
}
24+
}
25+
if (!linkIncluded)
26+
{
27+
HtmlGenericControl csslink = new HtmlGenericControl("link");
28+
csslink.ID = "FontAwesomeStylesheet";
29+
csslink.Attributes.Add("href", "/css/font-awesome.css");
30+
csslink.Attributes.Add("type", "text/css");
31+
csslink.Attributes.Add("rel", "stylesheet");
32+
Page.Header.Controls.Add(csslink);
33+
}
34+
}
35+
protected void Page_Load(object sender, EventArgs e)
36+
{
37+
38+
if (!Page.IsPostBack)
39+
{
40+
ClassNameRetrievalService _service = new ClassNameRetrievalService("/css/font-awesome.css", "large", @"\.fa-([^:]*?):before");
41+
lvIcons.DataSource = _service.GetClassNames();
42+
lvIcons.DataBind();
43+
ddlIcons.DataSource = _service.GetClassNames();
44+
ddlIcons.DataBind();
45+
ddlIcons.Items.Insert(0, new ListItem("Choose...", ""));
46+
47+
48+
}
49+
50+
}
51+
52+
#region IUsercontrolDataEditor Members
53+
54+
public object value
55+
{
56+
get
57+
{
58+
return ddlIcons.SelectedValue;
59+
}
60+
set
61+
{
62+
if (!String.IsNullOrEmpty(value.ToString()))
63+
{
64+
ddlIcons.SelectedValue = value.ToString();
65+
}
66+
}
67+
}
68+
69+
#endregion
70+
}
71+
}

usercontrols/FontAwesomeV4IconPicker.ascx.designer.cs

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)