Skip to content

Commit f2f21a5

Browse files
committed
Remove code behind from standard theme to make it more portable
1 parent 571eed1 commit f2f21a5

5 files changed

Lines changed: 35 additions & 109 deletions

File tree

BlogEngine/BlogEngine.NET/BlogEngine.NET.csproj

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,13 +2284,6 @@
22842284
<Compile Include="Custom\Themes\RazorHost\site.master.designer.cs">
22852285
<DependentUpon>site.master</DependentUpon>
22862286
</Compile>
2287-
<Compile Include="Custom\Themes\Standard\site.master.cs">
2288-
<DependentUpon>site.master</DependentUpon>
2289-
<SubType>ASPXCodeBehind</SubType>
2290-
</Compile>
2291-
<Compile Include="Custom\Themes\Standard\site.master.designer.cs">
2292-
<DependentUpon>site.master</DependentUpon>
2293-
</Compile>
22942287
<Compile Include="Custom\Controls\CommentList.ascx.cs">
22952288
<DependentUpon>CommentList.ascx</DependentUpon>
22962289
<SubType>ASPXCodeBehind</SubType>

BlogEngine/BlogEngine.NET/Custom/Themes/Standard/site.master

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
1-
<%@ Master Language="C#" AutoEventWireup="true" Inherits="StandardSite" CodeBehind="site.master.cs" %>
1+
<%@ Master Language="C#" AutoEventWireup="true" %>
22
<%@ Import Namespace="BlogEngine.Core" %>
3-
<%@ Import Namespace="System.Linq" %>
3+
<%
4+
Page.Header.DataBind();
5+
6+
//TO fix the bug related TO Perisan Culture
7+
if (System.Threading.Thread.CurrentThread.CurrentCulture.LCID == 1065)
8+
System.Threading.Thread.CurrentThread.CurrentCulture = new PersianCulture();
9+
// for supported of RTL languages
10+
if (Resources.labels.LangDirection.Equals("rtl", StringComparison.OrdinalIgnoreCase))
11+
{
12+
var lc = new LiteralControl("<link href=\"" + Utils.RelativeWebRoot + "Custom/Themes/Standard/css/rtl.css\" rel=\"stylesheet\" />");
13+
HeadContent.Controls.Add(lc);
14+
}
15+
16+
if (Security.IsAuthenticated)
17+
{
18+
aLogin.InnerText = Resources.labels.logoff;
19+
aLogin.HRef = Utils.RelativeWebRoot + "Account/login.aspx?logoff";
20+
}
21+
else
22+
{
23+
aLogin.HRef = Utils.RelativeWebRoot + "Account/login.aspx";
24+
aLogin.InnerText = Resources.labels.login;
25+
}
26+
%>
427
<!DOCTYPE html>
528
<html lang="en">
629
<head runat="server">
@@ -10,10 +33,10 @@
1033
<link rel="shortcut icon" href="~/Content/images/blog/blogengine.ico" type="image/x-icon" />
1134
<link href="~/scripts/syntaxhighlighter/styles/shCore.css" rel="stylesheet" type="text/css" />
1235
<link href="~/scripts/syntaxhighlighter/styles/shThemeDefault.css" rel="stylesheet" type="text/css" />
13-
<script type="text/javascript" src="<%# ShRoot %>scripts/XRegExp.js"></script>
14-
<script type="text/javascript" src="<%# ShRoot %>scripts/shCore.js"></script>
15-
<script type="text/javascript" src="<%# ShRoot %>scripts/shAutoloader.js"></script>
16-
<script type="text/javascript" src="<%# ShRoot %>shActivator.js"></script>
36+
<script type="text/javascript" src="<%# Utils.ApplicationRelativeWebRoot %>scripts/syntaxhighlighter/scripts/XRegExp.js"></script>
37+
<script type="text/javascript" src="<%# Utils.ApplicationRelativeWebRoot %>scripts/syntaxhighlighter/scripts/shCore.js"></script>
38+
<script type="text/javascript" src="<%# Utils.ApplicationRelativeWebRoot %>scripts/syntaxhighlighter/scripts/shAutoloader.js"></script>
39+
<script type="text/javascript" src="<%# Utils.ApplicationRelativeWebRoot %>scripts/syntaxhighlighter/shActivator.js"></script>
1740
<asp:ContentPlaceHolder ID="HeadContent" runat="server"></asp:ContentPlaceHolder>
1841
</head>
1942
<body class="<%=Resources.labels.LangDirection %>">

BlogEngine/BlogEngine.NET/Custom/Themes/Standard/site.master.cs

Lines changed: 0 additions & 38 deletions
This file was deleted.

BlogEngine/BlogEngine.NET/Custom/Themes/Standard/site.master.designer.cs

Lines changed: 0 additions & 58 deletions
This file was deleted.

BlogEngine/BlogEngine.NET/Scripts/Auto/blog.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,9 @@ BlogEngine = {
284284
// Searches the blog based on the entered text and
285285
// searches comments as well if chosen.
286286
search: function (root, searchfield) {
287+
if (!searchfield) {
288+
searchfield = 'searchfield';
289+
}
287290
var input = this.$(searchfield);
288291
var check = this.$("searchcomments");
289292

@@ -299,6 +302,9 @@ BlogEngine = {
299302
,
300303
// Clears the search fields on focus.
301304
searchClear: function (defaultText, searchfield) {
305+
if (!searchfield) {
306+
searchfield = 'searchfield';
307+
}
302308
var input = this.$(searchfield);
303309
if (input.value == defaultText)
304310
input.value = "";

0 commit comments

Comments
 (0)