Permalink
Browse files

getting everything working

  • Loading branch information...
1 parent 1efd751 commit 5f8e3ef7b29abbe38870f4830f60ed0558538d55 @shellscape shellscape committed Mar 14, 2012
@@ -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">
@@ -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>
@@ -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) {
+
+ }
+ }
+}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -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,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
@@ -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);
+ }
+
}
}
@@ -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
@@ -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,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") { }

0 comments on commit 5f8e3ef

Please sign in to comment.