| 37 |
<asp:RegularExpressionValidator runat="server" ControlToValidate="txtEmail" ErrorMessage="<%$Resources:labels, enterValidEmail %>" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ValidationGroup="AddComment" /><br /> |
= |
37 |
<asp:RegularExpressionValidator runat="server" ControlToValidate="txtEmail" ErrorMessage="<%$Resources:labels, enterValidEmail %>" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ValidationGroup="AddComment" /><br /> |
| 38 |
|
|
38 |
|
| 39 |
<label for="<%=txtWebsite.ClientID %>"><%=Resources.labels.website %></label> |
|
39 |
<label for="<%=txtWebsite.ClientID %>"><%=Resources.labels.website %></label> |
| 40 |
<asp:TextBox runat="Server" ID="txtWebsite" TabIndex="3" ValidationGroup="AddComment" /> |
|
40 |
<asp:TextBox runat="Server" ID="txtWebsite" TabIndex="3" ValidationGroup="AddComment" /> |
| 41 |
<asp:RegularExpressionValidator runat="Server" ControlToValidate="txtWebsite" ValidationExpression="(http://|https://|)([\w-]+\.)+[\w-]+(/[\w- ./?%&=;~]*)?" ErrorMessage="<%$Resources:labels, enterValidUrl %>" Display="Dynamic" ValidationGroup="AddComment" /><br /> |
|
41 |
<asp:RegularExpressionValidator runat="Server" ControlToValidate="txtWebsite" ValidationExpression="(http://|https://|)([\w-]+\.)+[\w-]+(/[\w- ./?%&=;~]*)?" ErrorMessage="<%$Resources:labels, enterValidUrl %>" Display="Dynamic" ValidationGroup="AddComment" /><br /> |
| 42 |
|
|
42 |
|
| |
|
-+ |
43 |
Enter the word |
| |
|
|
44 |
<table style="display:inline"> |
| |
|
|
45 |
<tr><td> |
| |
|
|
46 |
<asp:Image ID="Image1" runat="server" ImageUrl="/images/captcha word.png" AlternateText="captcha word" /> |
| |
|
|
47 |
</td></tr> |
| |
|
|
48 |
<tr><td> |
| |
|
|
49 |
(<a href="/audio/captcha word.mp3">hear it spoken</a>) |
| |
|
|
50 |
</td></tr> |
| |
|
|
51 |
</table> |
| |
|
|
52 |
<asp:TextBox runat="Server" ID="txtNaiveCaptcha" Width="150" TabIndex="3" ValidationGroup="AddComment" /> |
| |
|
|
53 |
<asp:RequiredFieldValidator runat="server" ControlToValidate="txtNaiveCaptcha" ErrorMessage="Please enter the correct word" Display="dynamic" ValidationGroup="AddComment" /> |
| |
|
|
54 |
<%-- <asp:RegularExpressionValidator runat="Server" EnableClientScript="false" ControlToValidate="txtNaiveCaptcha" ValidationExpression="chicken" ErrorMessage="Please enter the correct word" ValidationGroup="AddComment" /> --%> |
| |
|
|
55 |
<br /><br /> |
| |
|
|
56 |
|
| 43 |
<% if(BlogSettings.Instance.EnableCountryInComments){ %> |
= |
57 |
<% if(BlogSettings.Instance.EnableCountryInComments){ %> |
| 44 |
<label for="<%=ddlCountry.ClientID %>"><%=Resources.labels.country %></label> |
|
58 |
<label for="<%=ddlCountry.ClientID %>"><%=Resources.labels.country %></label> |
| 45 |
<asp:DropDownList runat="server" ID="ddlCountry" onchange="SetFlag(this.value)" TabIndex="4" EnableViewState="false" ValidationGroup="AddComment" /> |
|
59 |
<asp:DropDownList runat="server" ID="ddlCountry" onchange="SetFlag(this.value)" TabIndex="4" EnableViewState="false" ValidationGroup="AddComment" /> |
| 46 |
<asp:Image runat="server" ID="imgFlag" AlternateText="Country flag" Width="16" Height="11" EnableViewState="false" /><br /><br /> |
|
60 |
<asp:Image runat="server" ID="imgFlag" AlternateText="Country flag" Width="16" Height="11" EnableViewState="false" /><br /><br /> |
| 47 |
<%} %> |
|
61 |
<%} %> |
| 48 |
|
|
62 |
|
| |
| 74 |
|
= |
88 |
|
| 75 |
|
|
89 |
|
| 76 |
|
|
90 |
|
| 77 |
|
|
91 |
|
| 78 |
|
|
92 |
|
| 79 |
|
|
93 |
|
| |
|
-+ |
94 |
var naiveCaptchaBox = $("<%= txtNaiveCaptcha.ClientID %>"); |
| 80 |
|
= |
95 |
|
| 81 |
|
|
96 |
|
| 82 |
|
|
97 |
|
| 83 |
|
|
98 |
|
| 84 |
|
|
99 |
|
| 85 |
|
|
100 |
|
| 50 |
string country = args[3]; |
= |
50 |
string country = args[3]; |
| 51 |
string content = args[4]; |
|
51 |
string content = args[4]; |
| 52 |
bool notify = bool.Parse(args[5]); |
|
52 |
bool notify = bool.Parse(args[5]); |
| 53 |
bool isPreview = bool.Parse(args[6]); |
|
53 |
bool isPreview = bool.Parse(args[6]); |
| 54 |
string sentCaptcha = args[7]; |
|
54 |
string sentCaptcha = args[7]; |
| 55 |
string storedCaptcha = hfCaptcha.Value; |
|
55 |
string storedCaptcha = hfCaptcha.Value; |
| |
|
-+ |
56 |
string word = args[8]; |
| 56 |
|
= |
57 |
|
| 57 |
if (sentCaptcha != storedCaptcha) |
|
58 |
if (sentCaptcha != storedCaptcha) |
| 58 |
return; |
|
59 |
return; |
| |
|
-+ |
60 |
if (!isPreview && word != "chicken") |
| |
|
|
61 |
{ |
| |
|
|
62 |
_Callback = "failedCaptcha"; |
| |
|
|
63 |
return; |
| |
|
|
64 |
} |
| 59 |
|
= |
65 |
|
| 60 |
Comment comment = new Comment(); |
|
66 |
Comment comment = new Comment(); |
| 61 |
comment.Id = Guid.NewGuid(); |
|
67 |
comment.Id = Guid.NewGuid(); |
| 62 |
comment.Author = Server.HtmlEncode(author); |
|
68 |
comment.Author = Server.HtmlEncode(author); |
| 63 |
comment.Email = email; |
|
69 |
comment.Email = email; |
| 64 |
comment.Content = Server.HtmlEncode(content); |
|
70 |
comment.Content = Server.HtmlEncode(content); |
| 52 |
var email = emailBox.value; |
= |
52 |
var email = emailBox.value; |
| 53 |
var website = websiteBox.value; |
|
53 |
var website = websiteBox.value; |
| 54 |
var country = countryDropDown ? countryDropDown.value : ""; |
|
54 |
var country = countryDropDown ? countryDropDown.value : ""; |
| 55 |
var content = contentBox.value; |
|
55 |
var content = contentBox.value; |
| 56 |
var notify = $("cbNotify").checked; |
|
56 |
var notify = $("cbNotify").checked; |
| 57 |
var captcha = captchaField.value; |
|
57 |
var captcha = captchaField.value; |
| |
|
-+ |
58 |
var naiveCaptcha = naiveCaptchaBox.value; |
| 58 |
|
= |
59 |
|
| 59 |
var callback = isPreview ? EndShowPreview : AppendComment; |
|
60 |
var callback = isPreview ? EndShowPreview : AppendComment; |
| 60 |
var argument = author + "-|-" + email + "-|-" + website + "-|-" + country + "-|-" + content + "-|-" + notify + "-|-" + isPreview + "-|-" + captcha; |
<> |
61 |
var argument = author + "-|-" + email + "-|-" + website + "-|-" + country + "-|-" + content + "-|-" + notify + "-|-" + isPreview + "-|-" + captcha + "-|-" + naiveCaptcha; |
| 61 |
|
= |
62 |
|
| 62 |
WebForm_DoCallback('ctl00$cphBody$CommentView1',argument, callback,'comment',null,false); |
|
63 |
WebForm_DoCallback('ctl00$cphBody$CommentView1',argument, callback,'comment',null,false); |
| 63 |
|
|
64 |
|
| 64 |
if (!isPreview && typeof OnComment != "undefined") |
|
65 |
if (!isPreview && typeof OnComment != "undefined") |
| 65 |
OnComment(author, email, website, country, content); |
|
66 |
OnComment(author, email, website, country, content); |
| 66 |
} |
|
67 |
} |
| 67 |
|
|
68 |
|
| 68 |
function AppendComment(args, context) |
|
69 |
function AppendComment(args, context) |
| 69 |
{ |
|
70 |
{ |
| 70 |
if (context == "comment") |
|
71 |
if (context == "comment") |
| 71 |
{ |
|
72 |
{ |
| |
|
<> |
73 |
|
| |
|
|
74 |
if (args != "failedCaptcha") { |
| 72 |
var commentList = $("commentlist"); |
|
75 |
var commentList = $("commentlist"); |
| 73 |
|
|
76 |
|
| 74 |
if (commentList.innerHTML.length < 10) |
|
77 |
if (commentList.innerHTML.length < 10) |
| 75 |
commentList.innerHTML = "<h1 id='comment'>" + KEYcomments + "</h1>" |
|
78 |
commentList.innerHTML = "<h1 id='comment'>" + KEYcomments + "</h1>" |
| 76 |
|
|
79 |
|
| 77 |
commentList.innerHTML += args; |
|
80 |
commentList.innerHTML += args; |
| 78 |
commentList.style.display = 'block'; |
|
81 |
commentList.style.display = 'block'; |
| 79 |
contentBox.value = ""; |
|
82 |
contentBox.value = ""; |
| 80 |
$("ajaxLoader").style.display = "none"; |
|
|
|
| 81 |
$("status").className = "success"; |
|
83 |
$("status").className = "success"; |
| 82 |
|
|
84 |
|
| 83 |
if (!moderation) |
|
85 |
if (!moderation) |
| 84 |
$("status").innerHTML = KEYcommentWasSaved; |
|
86 |
$("status").innerHTML = KEYcommentWasSaved; |
| 85 |
else |
|
87 |
else |
| 86 |
$("status").innerHTML = KEYcommentWaitingModeration; |
|
88 |
$("status").innerHTML = KEYcommentWaitingModeration; |
| |
|
|
89 |
} |
| |
|
|
90 |
else { |
| |
|
|
91 |
$("status").innerHTML = "<span style=\"color: red; font-weight: bold\">Please enter the correct word</span>"; |
| |
|
|
92 |
} |
| |
|
|
93 |
|
| |
|
|
94 |
$("ajaxLoader").style.display = "none"; |
| 87 |
} |
= |
95 |
} |
| 88 |
|
|
96 |
|
| 89 |
$("btnSaveAjax").disabled = false; |
|
97 |
$("btnSaveAjax").disabled = false; |
| 90 |
} |
|
98 |
} |
| 91 |
|
|
99 |
|
| 92 |
function CheckAuthorName(sender, args) |
|
100 |
function CheckAuthorName(sender, args) |