mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Making use of the autofocus attribute
--HG-- branch : dev
This commit is contained in:
@@ -22,8 +22,9 @@
|
|||||||
} %>
|
} %>
|
||||||
<%=Html.ActionLink(T("Edit").ToString(), "edit", new {tenantName = tenant.Name, area = "Orchard.MultiTenancy"}) %><%
|
<%=Html.ActionLink(T("Edit").ToString(), "edit", new {tenantName = tenant.Name, area = "Orchard.MultiTenancy"}) %><%
|
||||||
if (!string.Equals(tenant.Name, "default", StringComparison.OrdinalIgnoreCase)) { //todo: (heskew) base this off the view model so logic on what can be removed and have its state changed stays in the controller
|
if (!string.Equals(tenant.Name, "default", StringComparison.OrdinalIgnoreCase)) { //todo: (heskew) base this off the view model so logic on what can be removed and have its state changed stays in the controller
|
||||||
%><%=_Encoded(" | ")%>
|
%><%--
|
||||||
<%=Html.ActionLink(T("Remove").ToString(), "delete", new {tenantName = tenant.Name, area = "Orchard.MultiTenancy"}) %><%
|
delete not implemented! <%=_Encoded(" | ")%>
|
||||||
|
<%=Html.ActionLink(T("Remove").ToString(), "delete", new {tenantName = tenant.Name, area = "Orchard.MultiTenancy"}) %>--%><%
|
||||||
} %>
|
} %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -97,7 +97,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Module.txt" />
|
<Content Include="Module.txt" />
|
||||||
<Content Include="Scripts\setup.js" />
|
|
||||||
<Content Include="Views\Web.config" />
|
<Content Include="Views\Web.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<SetupViewModel>" %>
|
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<SetupViewModel>" %>
|
||||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
|
||||||
<%@ Import Namespace="Orchard.Setup.ViewModels"%>
|
<%@ Import Namespace="Orchard.Setup.ViewModels"%>
|
||||||
<h1><%=Html.TitleForPage(_Encoded("Get Started").ToHtmlString())%></h1>
|
<h1><%=Html.TitleForPage(_Encoded("Get Started").ToHtmlString())%></h1>
|
||||||
<%
|
<%
|
||||||
@@ -9,7 +8,7 @@ using (Html.BeginFormAntiForgeryPost()) { %>
|
|||||||
<fieldset class="site">
|
<fieldset class="site">
|
||||||
<div>
|
<div>
|
||||||
<label for="SiteName"><%=_Encoded("What is the name of your site?") %></label>
|
<label for="SiteName"><%=_Encoded("What is the name of your site?") %></label>
|
||||||
<%=Html.EditorFor(svm => svm.SiteName) %>
|
<%=Html.TextBoxFor(svm => svm.SiteName, new { autofocus = "autofocus" })%>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label for="AdminUsername"><%=_Encoded("Choose a user name:") %></label>
|
<label for="AdminUsername"><%=_Encoded("Choose a user name:") %></label>
|
||||||
|
@@ -3,9 +3,17 @@ jQuery.fn.extend({
|
|||||||
helpfullyFocus: function() {
|
helpfullyFocus: function() {
|
||||||
var _this = $(this);
|
var _this = $(this);
|
||||||
var firstError = _this.find(".input-validation-error").first();
|
var firstError = _this.find(".input-validation-error").first();
|
||||||
return firstError.size() === 1
|
// try to focus the first error on the page
|
||||||
? firstError.focus()
|
if (firstError.size() === 1) {
|
||||||
: _this.find("input:text").first().focus();
|
return firstError.focus();
|
||||||
|
}
|
||||||
|
// or, give it up to the browser to autofocus
|
||||||
|
if ('autofocus' in document.createElement('input')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// otherwise, make the autofocus attribute work
|
||||||
|
var autofocus = _this.find(":input[autofocus=autofocus]").first();
|
||||||
|
return autofocus.focus();
|
||||||
},
|
},
|
||||||
toggleWhatYouControl: function() {
|
toggleWhatYouControl: function() {
|
||||||
var _this = $(this);
|
var _this = $(this);
|
||||||
@@ -52,4 +60,8 @@ jQuery.fn.extend({
|
|||||||
_this.css({ "position": "absolute", "left": "-9999em" });
|
_this.css({ "position": "absolute", "left": "-9999em" });
|
||||||
$("body").append(_this);
|
$("body").append(_this);
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
// a little better autofocus
|
||||||
|
$(function() {
|
||||||
|
$("body").helpfullyFocus();
|
||||||
|
});
|
@@ -8,8 +8,8 @@ using (Html.BeginFormAntiForgeryPost(Url.Action("LogOn", new {ReturnUrl = Reques
|
|||||||
<fieldset>
|
<fieldset>
|
||||||
<legend><%=_Encoded("Account Information")%></legend>
|
<legend><%=_Encoded("Account Information")%></legend>
|
||||||
<div>
|
<div>
|
||||||
<label for="username"><%=_Encoded("Username or Email:")%></label>
|
<label for="userNameOrEmail"><%=_Encoded("Username or Email:")%></label>
|
||||||
<%= Html.TextBox("userNameOrEmail")%>
|
<%= Html.TextBox("userNameOrEmail", "", new { autofocus = "autofocus" })%>
|
||||||
<%= Html.ValidationMessage("userNameOrEmail")%>
|
<%= Html.ValidationMessage("userNameOrEmail")%>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@@ -22,5 +22,4 @@ using (Html.BeginFormAntiForgeryPost(Url.Action("LogOn", new {ReturnUrl = Reques
|
|||||||
</div>
|
</div>
|
||||||
<input type="submit" value="<%=_Encoded("Log On") %>" />
|
<input type="submit" value="<%=_Encoded("Log On") %>" />
|
||||||
</fieldset><%
|
</fieldset><%
|
||||||
} %><%
|
} %>
|
||||||
using (this.Capture("end-of-page-scripts")) { %><script type="text/javascript">$("#username").closest("form").helpfullyFocus();</script><% } %>
|
|
@@ -10,7 +10,7 @@ using (Html.BeginFormAntiForgeryPost(Url.Action("LogOn", new {ReturnUrl = Reques
|
|||||||
<legend><%=_Encoded("Account Information")%></legend>
|
<legend><%=_Encoded("Account Information")%></legend>
|
||||||
<div class="group">
|
<div class="group">
|
||||||
<label for="username"><%=_Encoded("Username:")%></label>
|
<label for="username"><%=_Encoded("Username:")%></label>
|
||||||
<%= Html.TextBox("username")%>
|
<%= Html.TextBox("username", "", new { autofocus = "autofocus" })%>
|
||||||
<%= Html.ValidationMessage("username")%>
|
<%= Html.ValidationMessage("username")%>
|
||||||
</div>
|
</div>
|
||||||
<div class="group">
|
<div class="group">
|
||||||
@@ -23,5 +23,4 @@ using (Html.BeginFormAntiForgeryPost(Url.Action("LogOn", new {ReturnUrl = Reques
|
|||||||
</div>
|
</div>
|
||||||
<input type="submit" value="<%=_Encoded("Log On") %>" />
|
<input type="submit" value="<%=_Encoded("Log On") %>" />
|
||||||
</fieldset><%
|
</fieldset><%
|
||||||
} %><%
|
} %>
|
||||||
using (this.Capture("end-of-page-scripts")) { %><script type="text/javascript">$("#username").closest("form").helpfullyFocus();</script><% } %>
|
|
@@ -10,7 +10,7 @@ using (Html.BeginFormAntiForgeryPost(Url.Action("LogOn", new {ReturnUrl = Reques
|
|||||||
<legend><%=_Encoded("Account Information")%></legend>
|
<legend><%=_Encoded("Account Information")%></legend>
|
||||||
<div class="group">
|
<div class="group">
|
||||||
<label for="username"><%=_Encoded("Username:")%></label>
|
<label for="username"><%=_Encoded("Username:")%></label>
|
||||||
<%= Html.TextBox("username")%>
|
<%= Html.TextBox("username", "", new { autofocus = "autofocus" })%>
|
||||||
<%= Html.ValidationMessage("username")%>
|
<%= Html.ValidationMessage("username")%>
|
||||||
</div>
|
</div>
|
||||||
<div class="group">
|
<div class="group">
|
||||||
@@ -23,5 +23,4 @@ using (Html.BeginFormAntiForgeryPost(Url.Action("LogOn", new {ReturnUrl = Reques
|
|||||||
</div>
|
</div>
|
||||||
<input type="submit" value="<%=_Encoded("Log On") %>" />
|
<input type="submit" value="<%=_Encoded("Log On") %>" />
|
||||||
</fieldset><%
|
</fieldset><%
|
||||||
} %><%
|
} %>
|
||||||
using (this.Capture("end-of-page-scripts")) { %><script type="text/javascript">$("#username").closest("form").helpfullyFocus();</script><% } %>
|
|
Reference in New Issue
Block a user