forked from marcemarc/monosnow.umbraco.uCssClassNameDropdown
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
9 changed files
with
7,314 additions
and
3 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="BootstrapIconPicker.ascx.cs" Inherits="monosnow.umbraco.uCssClassNameDropdown.usercontrols.BootstrapIconPicker" %> | ||
<asp:ListView ID="lvIcons" runat="server" ItemPlaceholderID="itemPlaceHolder" GroupItemCount="4" GroupPlaceholderID="groupPlaceHolder"> | ||
<LayoutTemplate> | ||
<div style="height:250px; width:650px;overflow:scroll"> | ||
<asp:PlaceHolder ID="groupPlaceHolder" runat="server"></asp:PlaceHolder> | ||
</div> | ||
</LayoutTemplate> | ||
<GroupTemplate> | ||
<div style="clear:both"></div> | ||
<div> | ||
<asp:PlaceHolder ID="itemPlaceHolder" runat="server"></asp:PlaceHolder> | ||
</div> | ||
</GroupTemplate> | ||
<ItemTemplate> | ||
<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> | ||
</ItemTemplate> | ||
</asp:ListView> | ||
<asp:DropDownList ID="ddlIcons" runat="server"></asp:DropDownList> | ||
<script type="text/javascript"> | ||
function setDropdownValue(selectedValue) { | ||
document.getElementById("<%=ddlIcons.ClientID %>").value = selectedValue; | ||
} | ||
</script> |
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,70 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
using System.Web.UI; | ||
using System.Web.UI.WebControls; | ||
using System.Web.UI.HtmlControls; | ||
using monosnow.umbraco.uCssClassNameDropdown.Services; | ||
|
||
namespace monosnow.umbraco.uCssClassNameDropdown.usercontrols | ||
{ | ||
public partial class BootstrapIconPicker : System.Web.UI.UserControl | ||
{ | ||
protected override void OnPreRender(EventArgs e) | ||
{ | ||
bool linkIncluded = false; | ||
foreach (Control c in Page.Header.Controls) | ||
{ | ||
if (c.ID == "BootstrapStylesheet") | ||
{ | ||
linkIncluded = true; | ||
} | ||
} | ||
if (!linkIncluded) | ||
{ | ||
HtmlGenericControl csslink = new HtmlGenericControl("link"); | ||
csslink.ID = "BootstrapStylesheet"; | ||
csslink.Attributes.Add("href", "/css/bootstrap.css"); | ||
csslink.Attributes.Add("type", "text/css"); | ||
csslink.Attributes.Add("rel", "stylesheet"); | ||
Page.Header.Controls.Add(csslink); | ||
} | ||
} | ||
protected void Page_Load(object sender, EventArgs e) | ||
{ | ||
|
||
if (!Page.IsPostBack) | ||
{ | ||
ClassNameRetrievalService _service = new ClassNameRetrievalService("/css/bootstrap.css", "bar", @".icon-(\S*?)\s{"); | ||
lvIcons.DataSource = _service.GetClassNames(); | ||
lvIcons.DataBind(); | ||
ddlIcons.DataSource = _service.GetClassNames(); | ||
ddlIcons.DataBind(); | ||
ddlIcons.Items.Insert(0, new ListItem("Choose...", "")); | ||
|
||
|
||
} | ||
|
||
} | ||
|
||
#region IUsercontrolDataEditor Members | ||
|
||
public object value | ||
{ | ||
get | ||
{ | ||
return ddlIcons.SelectedValue; | ||
} | ||
set | ||
{ | ||
if (!String.IsNullOrEmpty(value.ToString())) | ||
{ | ||
ddlIcons.SelectedValue = value.ToString(); | ||
} | ||
} | ||
} | ||
|
||
#endregion | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.