mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Adding some helpful focus the form functionality for logon and setup
--HG-- branch : dev
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
jQuery.fn.extend({
|
||||
helpfullyFocus: function() {
|
||||
var _this = $(this);
|
||||
var firstError = _this.find(".input-validation-error").first();
|
||||
return firstError.size() === 1
|
||||
? firstError.focus()
|
||||
: _this.find("input:text").first().focus();
|
||||
},
|
||||
toggleWhatYouControl: function() {
|
||||
var _controller = $(this);
|
||||
var _controllees = $("[data-controllerid=" + _controller.attr("id") + "]");
|
||||
if (_controller.is(":checked")) {
|
||||
var _this = $(this);
|
||||
var _controllees = $("[data-controllerid=" + _this.attr("id") + "]");
|
||||
if (_this.is(":checked")) {
|
||||
$(_controllees.slideDown(200)[0]).find("input").focus();
|
||||
} else {
|
||||
_controllees.slideUp(200);
|
||||
|
@@ -88,6 +88,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Scripts\setup.js" />
|
||||
<Content Include="Views\Web.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
|
1
src/Orchard.Web/Modules/Orchard.Setup/Scripts/setup.js
Normal file
1
src/Orchard.Web/Modules/Orchard.Setup/Scripts/setup.js
Normal file
@@ -0,0 +1 @@
|
||||
$("#SiteName").closest("form").helpfullyFocus();
|
@@ -24,4 +24,5 @@
|
||||
<%=Html.AntiForgeryTokenOrchard()%>
|
||||
<input type="submit" value="<%=_Encoded("Log On") %>" />
|
||||
</fieldset>
|
||||
<% } %>
|
||||
<% } %><%
|
||||
using (this.Capture("end-of-page-scripts")) { %><script type="text/javascript">$("#username").closest("form").helpfullyFocus();</script><% } %>
|
@@ -1,9 +1,7 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<BodyEditorViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Core.Common.ViewModels"%>
|
||||
<% Html.RegisterScript("tiny_mce.js"); %>
|
||||
<%=Html.TextArea("Text", Model.Text, 25, 80, new { @class = "html" }) %>
|
||||
|
||||
<%
|
||||
<%=Html.TextArea("Text", Model.Text, 25, 80, new { @class = "html" }) %><%
|
||||
using (this.Capture("end-of-page-scripts")) {%>
|
||||
<script type="text/javascript">
|
||||
tinyMCE.init({
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BaseViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.UI.Resources"%>
|
||||
<%@ Import Namespace="System.IO"%>
|
||||
<%@ Import Namespace="Orchard.Mvc.ViewEngines"%>
|
||||
<%@ Import Namespace="Orchard.Mvc.ViewModels" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.Html" %>
|
||||
<% //todo: (heskew) this should really be using the IResourceManager if it's to be a theme especially for the jquery dep (w/out needing to copy into this theme...)
|
||||
@@ -8,6 +11,9 @@
|
||||
var basejs = ResolveUrl("~/Core/Themes/Scripts/base.js");
|
||||
Model.Zones.AddAction("content:after", html =>
|
||||
html.ViewContext.Writer.Write(@"<script type=""text/javascript"" src=""" + basejs + @"""></script>"));
|
||||
var setupjs = ResolveUrl("~/Modules/Orchard.Setup/Scripts/setup.js");
|
||||
Model.Zones.AddAction("content:after", html =>
|
||||
html.ViewContext.Writer.Write(@"<script type=""text/javascript"" src=""" + setupjs + @"""></script>"));
|
||||
var siteCss = ResolveUrl("../Styles/site.css");
|
||||
Model.Zones.AddAction("head:styles", html =>
|
||||
html.ViewContext.Writer.Write(@"<link rel=""stylesheet"" type=""text/css"" href=""" + siteCss + @"""/>"));
|
||||
|
Reference in New Issue
Block a user