Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

getting everything working

  • Loading branch information...
commit 5f8e3ef7b29abbe38870f4830f60ed0558538d55 1 parent 1efd751
@shellscape shellscape authored
View
8 Juice-Test-Site/JuiceUI Test Site.csproj
@@ -266,6 +266,13 @@
<Compile Include="Button.aspx.designer.cs">
<DependentUpon>Button.aspx</DependentUpon>
</Compile>
+ <Compile Include="Mobile.Master.cs">
+ <DependentUpon>Mobile.Master</DependentUpon>
+ <SubType>ASPXCodeBehind</SubType>
+ </Compile>
+ <Compile Include="Mobile.Master.designer.cs">
+ <DependentUpon>Mobile.Master</DependentUpon>
+ </Compile>
<Compile Include="Mobile\Page.aspx.cs">
<DependentUpon>Page.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -380,6 +387,7 @@
<None Include="fonts\junction\Junction-webfont.ttf" />
<None Include="fonts\junction\Junction-webfont.woff" />
<Content Include="packages.config" />
+ <Content Include="Mobile.Master" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Juice\JuiceUI.csproj">
View
18 Juice-Test-Site/Mobile.Master
@@ -0,0 +1,18 @@
+<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Mobile.master.cs" Inherits="Juice_Sample_Site.MobileMaster" %>
+<!DOCTYPE html>
+<html>
+ <head runat="server">
+ <title>Page Title</title>
+
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+</head>
+<body>
+ <form runat="server">
+ <div>
+ <asp:ScriptManager id="_Script" runat="server" />
+ <asp:ContentPlaceHolder ID="_Content" runat="server" />
+ </div>
+ </form>
+</body>
+</html>
View
14 Juice-Test-Site/Mobile.Master.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace Juice_Sample_Site {
+ public partial class MobileMaster : System.Web.UI.MasterPage {
+ protected void Page_Load(object sender, EventArgs e) {
+
+ }
+ }
+}
View
33 Juice-Test-Site/Mobile.Master.designer.cs
@@ -0,0 +1,33 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Juice_Sample_Site {
+
+
+ public partial class MobileMaster {
+
+ /// <summary>
+ /// _Script control.
+ /// </summary>
+ /// <remarks>
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ /// </remarks>
+ protected global::System.Web.UI.ScriptManager _Script;
+
+ /// <summary>
+ /// _Content control.
+ /// </summary>
+ /// <remarks>
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ /// </remarks>
+ protected global::System.Web.UI.WebControls.ContentPlaceHolder _Content;
+ }
+}
View
8 Juice-Test-Site/Mobile/Page.aspx
@@ -1,9 +1,13 @@
-<%@ Page Language="C#" MasterPageFile="~/Base.Master" AutoEventWireup="true" CodeBehind="Page.aspx.cs" Inherits="Juice_Sample_Site.Mobile.Page" %>
+<%@ Page Language="C#" MasterPageFile="~/Mobile.Master" AutoEventWireup="true" CodeBehind="Page.aspx.cs" Inherits="Juice_Sample_Site.Mobile.Page" %>
<asp:Content ContentPlaceHolderID="_Content" runat="server">
<mobile:page id="mypage" runat="server">
-
+ <mobile:header Text="Page Title" runat="server"/>
+ <mobile:content runat="server">
+ <p>Page content goes here.</p>
+ </mobile:content>
+ <mobile:footer Text="Page Footer" runat="server"/>
</mobile:page>
</asp:Content>
View
2  Juice/Mobile/Content.cs
@@ -2,10 +2,12 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.Web.UI;
namespace Juice.Mobile {
//Container with data-role="content"
+ [ParseChildren(false)]
public class Content : ThemeControlBase {
public Content() : base("content") { }
View
13 Juice/Mobile/Footer.cs
@@ -2,12 +2,15 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.Web.UI;
+using System.Web.UI.HtmlControls;
using Juice.Framework;
namespace Juice.Mobile {
//Container with data-role="footer"
+ [ParseChildren(false)]
public class Footer : ThemeControlBase {
public Footer() : base("footer") { }
@@ -20,5 +23,15 @@ public class Footer : ThemeControlBase {
[WidgetOption("position", null)]
public MobilePosition Position { get; set; }
+ public String Text { get; set; }
+
+ protected override void OnPreRender(EventArgs e) {
+
+ this.Controls.Clear();
+ this.Controls.Add(new HtmlGenericControl("h1") { InnerHtml = this.Text });
+
+ base.OnPreRender(e);
+ }
+
}
}
View
22 Juice/Mobile/Framework/MobileBridge.cs
@@ -28,17 +28,23 @@ public class MobileBridge {
this.SetDefaults();
}
- public static Boolean MetaViewPortExists { get; set; }
+ public Boolean MetaViewPortExists {
+ get {
+ Boolean? value = _bridgeTo.Page.Items["MobileBridge.MetaViewPortExists"] as Boolean?;
+ return value == null ? false : value.Value;
+ }
+ set { _bridgeTo.Page.Items["MobileBridge.MetaViewPortExists"] = value; }
+ }
private void RenderCss() {
_cssManager.Render(new List<String> {
- "jquery-ui"
+ "jquery-mobile"
});
}
private void RenderMeta() {
-
- if(MobileBridge.MetaViewPortExists) {
+
+ if(this.MetaViewPortExists) {
return;
}
@@ -47,7 +53,7 @@ public class MobileBridge {
HtmlMeta viewport = controls.OfType<HtmlMeta>().Where(m => m.Name != null && m.Name.ToLower() == "viewport").FirstOrDefault();
if(viewport != null) {
- MobileBridge.MetaViewPortExists = true;
+ this.MetaViewPortExists = true;
return;
}
@@ -57,6 +63,8 @@ public class MobileBridge {
};
header.Controls.Add(viewport);
+
+ this.MetaViewPortExists = true;
}
private void SetDefaults() {
@@ -111,8 +119,8 @@ public class MobileBridge {
object current = o.Property.GetValue(_bridgeTo);
- if(current != null && o.Option.DefaultValue != current) {
- attributes.SetAttribute("data-role", current.ToString().ToLower());
+ if((current == null && o.Option.DefaultValue != null) || (current != null && !current.Equals(o.Option.DefaultValue))) {
+ attributes.SetAttribute(String.Concat("data-", o.Option.Name), current.ToString().ToLower());
}
}
View
12 Juice/Mobile/Header.cs
@@ -2,12 +2,15 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.Web.UI;
+using System.Web.UI.HtmlControls;
using Juice.Framework;
namespace Juice.Mobile {
//Container with data-role="header"
+ [ParseChildren(false)]
public class Header : ThemeControlBase {
public Header() : base("header") { }
@@ -16,5 +19,14 @@ public class Header : ThemeControlBase {
[WidgetOption("position", null)]
public MobilePosition Position { get; set; }
+ public String Text { get; set; }
+
+ protected override void OnPreRender(EventArgs e) {
+
+ this.Controls.Clear();
+ this.Controls.Add(new HtmlGenericControl("h1") { InnerHtml = this.Text });
+
+ base.OnPreRender(e);
+ }
}
}
View
2  Juice/Mobile/Page.cs
@@ -2,12 +2,14 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.Web.UI;
using Juice.Framework;
namespace Juice.Mobile {
//Container with data-role="page"
+ [ParseChildren(false)]
public class Page : ThemeControlBase {
public Page() : base("page") { }
Please sign in to comment.
Something went wrong with that request. Please try again.