Skip to content

Commit 2655943

Browse files
authored
Merge branch 'master' into feature/multi-explicit
2 parents 871c525 + 69db30c commit 2655943

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

reCaptcha/ReCaptcha.cshtml

+25-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@* Generator: WebPagesHelper *@
1+
@* Generator: WebPagesHelper *@
22

33
@using System
44
@using System.Collections.Generic
@@ -131,7 +131,6 @@
131131
{
132132
return GetLastErrors(context).Select(e => Enum.GetName(typeof(ErrorCodes), e));
133133
}
134-
135134
}
136135

137136
@**
@@ -140,18 +139,39 @@
140139
* @param {string} publicKey - Your sitekey.
141140
* @param {string} theme - dark/light light Optional. The color theme of the widget.
142141
* @param {string} type - audio/image image Optional. The type of CAPTCHA to serve.
142+
* @param {string} size - compact/normal normal Optional. The size of the widget.
143+
* @param {int} tabIndex - 0 Optional. The tabindex of the widget and challenge. If other elements in your page use tabindex, it should be set to make user navigation easier.
143144
* @param {string} callback - Optional. Your callback function that's executed when the user submits a successful CAPTCHA response. The user's response, g-recaptcha-response, will be the input for your callback function.
145+
* @param {string} expiredCallback - Optional. The name of your callback function, executed when the reCAPTCHA response expires and the user needs to re-verify.
146+
* @param {string} errorCallback - Optional. The name of your callback function, executed when reCAPTCHA encounters an error (usually network connectivity) and cannot continue until connectivity is restored. If you specify a function here, you are responsible for informing the user that they should retry.
144147
* @param {string} lang - {@link https://developers.google.com/recaptcha/docs/language}
145148
*@
146-
@helper GetHtml(string publicKey = null, string theme = null, string type = null, string callback = null, string lang = null)
149+
@helper GetHtml(string publicKey = null,
150+
string theme = null,
151+
string type = null,
152+
string size = "normal",
153+
int tabIndex = 0,
154+
string callback = null,
155+
string expiredCallback = null,
156+
string errorCallback = null,
157+
string lang = null)
147158
{
148159
if (String.IsNullOrEmpty(publicKey))
149160
{
150161
throw new ArgumentException("can't be null", "publicKey");
151162
}
152163

153164
<script src="https://www.google.com/recaptcha/api.js?hl=@lang" async defer></script>
154-
<div class="g-recaptcha" data-sitekey="@publicKey" data-theme="@theme" data-type="@type" data-callback="@callback"></div>
165+
<div class="g-recaptcha"
166+
data-sitekey="@publicKey"
167+
data-theme="@theme"
168+
data-type="@type"
169+
data-size="@size"
170+
data-tabindex="@tabIndex"
171+
data-callback="@callback"
172+
data-expired-callback="@expiredCallback"
173+
data-error-callback="@errorCallback">
174+
</div>
155175
}
156176

157177
@**
@@ -251,4 +271,4 @@ var noEscapeOptionsJson = new HtmlString(optionsJson);
251271
{
252272
<text>grecaptcha.reset(@id)</text>
253273
}
254-
}
274+
}

0 commit comments

Comments
 (0)