Skip to content

Commit

Permalink
tweak alerting in helper javascript
Browse files Browse the repository at this point in the history
update global.json
update about
  • Loading branch information
ninianne98 committed Apr 23, 2024
1 parent 521127e commit 24b6e65
Show file tree
Hide file tree
Showing 14 changed files with 148 additions and 45 deletions.
57 changes: 32 additions & 25 deletions CMSAdmin/Views/CmsAdmin/About.cshtml
Expand Up @@ -5,7 +5,15 @@
}
<style>
body {
font-size: 1.05em;
font-size: 1.08em;
}

b {
color: #6a7960;
}

a {
color: #c76813;
}
</style>

Expand All @@ -31,13 +39,9 @@
The CarrotCakeCMS logo is &copy; 2011 Samantha Copeland
</p>
<p>
These works are licensed under a <a target="_blank" href="http://creativecommons.org/licenses/by-nc-nd/3.0/">
Creative Commons Attribution-NonCommercial-NoDerivs
3.0 Unported License
</a>.
</p>
<p>
These images may freely be used in conjunction with promotion of the CarrotCake CMS.
These images are licensed under a
Creative Commons <a target="_blank" href="https://creativecommons.org/licenses/by-nd/4.0/">CC BY-ND 4.0 Deed</a>
Attribution-NoDerivs 4.0 International.
</p>

<h2>
Expand All @@ -63,7 +67,7 @@
<br />
Copyright 2011, John Resig <br />
Dual licensed under the MIT or GPL Version 2 licenses. <br />
http://jquery.org/license <br />
<a target="_blank" href="http://jquery.org/license">http://jquery.org/license</a><br />
<br />
Includes Sizzle.js <br />
http://sizzlejs.com/ <br />
Expand Down Expand Up @@ -91,7 +95,8 @@
</p>
<p>
<b>iCheck</b> <br />
Damir Sultanov, <a target="_blank" href="http://fronteed.com/iCheck/">http://fronteed.com/iCheck/</a> <br />
Damir Sultanov, <a target="_blank" href="https://github.com/drgullin/icheck">https://github.com/drgullin/icheck</a> <br />
https://github.com/drgullin/icheck/blob/1.0.3/icheck.js<br />
iCheck plugin is released under the MIT License. Feel free to use it in personal and commercial projects. <br />
</p>
<p>
Expand All @@ -104,6 +109,7 @@
<b>jQuery UI Nested Sortable - jQuery Plugin</b> <br />
Copyright (c) 2010-2016 Manuele J Sarfatti and contributors <br />
<a target="_blank" href="https://github.com/ilikenwf/nestedSortable">https://github.com/ilikenwf/nestedSortable</a> <br />
(was: https://github.com/mjsarfatti/nestedSortable )
Licensed under the MIT License<br />
</p>
<p>
Expand All @@ -115,20 +121,22 @@
</p>
<p>
<b>Silk Icon Set</b> <br />
Mark James, <a target="_blank" href="https://github.com/legacy-icons/famfamfam-silk">https://github.com/legacy-icons/famfamfam-silk</a> <br />
This work is licensed under a Creative Commons Attribution 2.5 License. <br />
https://github.com/legacy-icons/famfamfam-silk/blob/master/LICENSE.md
Mark James, <a target="_blank" href="https://github.com/markjames/famfamfam-silk-icons">https://github.com/markjames/famfamfam-silk-icons</a> <br />
This work is licensed under a Creative Commons Attribution 2.5 License.
(was: http://www.famfamfam.com/lab/icons/silk/ ) <br />
https://github.com/markjames/famfamfam-silk-icons/blob/master/readme.txt
<br />
</p>
<p>
<b>Preloaders.net</b> <br />
AJAX Spinners. All animated GIF and APNG images are completely free to use in all projects (web and desktop applications, freeware and commercial projects). <br />
AJAX Spinners. All animated GIF and APNG images are completely free to use in all projects
(web and desktop applications, freeware and commercial projects). <br />
<a target="_blank" href="http://preloaders.net/">http://preloaders.net/</a> <br />
</p>
<p>
<b>ajaxload.info</b> <br />
Ajaxload - Ajax loading gif generator. Generated gifs are totally free for use. <br />
<a target="_blank" href="http://ajaxload.info/">http://ajaxload.info/</a> <br />
http://ajaxload.info/ <br />
</p>
<p>
<b>normalize.css</b><br />
Expand All @@ -137,15 +145,14 @@
</p>
<p>
<b>Base64 encode / decode</b><br />
https://github.com/client9/stringencoders/tree/master/javascript <br />
<a target="_blank" href="https://github.com/client9/stringencoders/tree/master/javascript">https://github.com/client9/stringencoders/tree/master/javascript</a> <br />
Copyright (c) 2010 Nick Galbreath <br />
MIT License https://github.com/client9/stringencoders/blob/master/javascript/base64.js <br />
</p>
<p>
<b>Tooltipster</b><br />
http://calebjacob.github.io/tooltipster/ <br />
The MIT License (MIT) Copyright (c) 2015 Caleb Jacob <br />
<a target="_blank" href="https://github.com/iamceege/tooltipster">https://github.com/iamceege/tooltipster</a> <br />
The MIT License (MIT) Copyright (c) 2015 Caleb Jacob <br />
</p>
<p>
<b>jQuery MiniColors: A tiny color picker built on jQuery</b><br />
Expand All @@ -154,7 +161,7 @@
</p>
<p>
<b>jQuery blockUI - jQuery Plugin</b> <br />
Examples at: http://malsup.com/jquery/block/ <br />
Examples at: <a target="_blank" href="http://malsup.com/jquery/block/">http://malsup.com/jquery/block/</a><br />
Copyright (c) 2007-2010 M. Alsup <br />
Dual licensed under the MIT and GPL licenses: <br />
http://opensource.org/licenses/MIT <br />
Expand All @@ -168,6 +175,7 @@
<p>
<b>SimpleModal - jQuery Plugin</b> <br />
<a target="_blank" href="http://www.ericmmartin.com/projects/simplemodal/">http://www.ericmmartin.com/projects/simplemodal/</a> <br />
<a target="_blank" href="https://github.com/ericmmartin/simplemodal">https://github.com/ericmmartin/simplemodal</a> <br />
Copyright (c) 2010 Eric Martin
<br />
Dual licensed under the MIT and GPL licenses <br />
Expand All @@ -183,8 +191,7 @@
Copyright (c) 2022 Ephox Corporation DBA <a target="_blank" href="https://www.tiny.cloud">Tiny Technologies, Inc.</a>
(<a target="_blank" href="https://github.com/tinymce/tinymce/tree/release/6">GitHub</a>),
All rights reserved. <br />
Released under the MIT License <br />
<br />
Released under the <a target="_blank" href="https://github.com/tinymce/tinymce/blob/release/6/LICENSE.TXT">MIT License</a> <br />
License: https://github.com/tinymce/tinymce/blob/release/6/LICENSE.TXT <br />
<br />
</p>
Expand All @@ -194,7 +201,7 @@
</h2>
<p>
Copyright (c) 2011, 2015, 2023, 2024 Samantha Copeland, <a target="_blank" href="http://www.carrotware.com/">http://www.carrotware.com/</a>
&lt;<a target="_blank" href="https://opensource.org/licenses/MIT">https://opensource.org/licenses/MIT</a>&gt;
&lt;<a target="_blank" href="https://opensource.org/license/MIT">https://opensource.org/license/MIT</a>&gt;
</p>
<p>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to
Expand All @@ -215,9 +222,9 @@
<p>
Copyright &copy; 2007 Free Software Foundation, Inc. &lt;<a target="_blank" href="http://fsf.org/">http://fsf.org/</a>&gt;
<br />
&lt;<a target="_blank" href="http://www.gnu.org/licenses/gpl-3.0.html">http://www.gnu.org/licenses/gpl-3.0.html</a>&gt;
&lt;<a target="_blank" href="https://www.gnu.org/licenses/gpl-3.0.html">https://www.gnu.org/licenses/gpl-3.0.html</a>&gt;
or
&lt;<a target="_blank" href="https://opensource.org/licenses/GPL-3.0">https://opensource.org/licenses/GPL-3.0</a>&gt;
&lt;<a target="_blank" href="https://opensource.org/license/GPL-3.0">https://opensource.org/license/GPL-3.0</a>&gt;
</p>
<p>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Expand Down Expand Up @@ -931,7 +938,7 @@
<p>
Copyright (c) &lt;YEAR&gt;, &lt;OWNER&gt;<br />
All rights reserved.
&lt;<a target="_blank" href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a>&gt;
&lt;<a target="_blank" href="https://opensource.org/license/BSD-3-Clause">https://opensource.org/license/BSD-3-Clause</a>&gt;
</p>
<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p>
<p>1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</p>
Expand Down
4 changes: 3 additions & 1 deletion LoremIpsum/LoremIpsum.csproj
Expand Up @@ -42,7 +42,9 @@
<Compile Include="Program.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="global.json" />
<Content Include="global.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Properties\C3ConfigSchema.json" />
<Content Include="Properties\launchSettings.json" />
<Content Include="Views\_ViewStart.cshtml" />
Expand Down
2 changes: 1 addition & 1 deletion LoremIpsum/global.json
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.15",
"version": "8.0.2",
"rollForward": "latestMinor",
"allowPrerelease": false
}
Expand Down
3 changes: 3 additions & 0 deletions Northwind/Northwind.csproj
Expand Up @@ -124,5 +124,8 @@
<Content Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Update="global.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>
58 changes: 53 additions & 5 deletions Northwind/Views/Admin/Math.cshtml
Expand Up @@ -7,35 +7,83 @@
string theTime = DateTime.Now.ToString("o");
}

<script type="text/javascript">
$(document).ready(function () {
$('#mathForm1 input[type="submit"]').click(function () {
var is_valid = true;
var form_data = $("#mathForm1").serializeArray();
$("#mathForm1").attr('data-ajax-valid', false);

for (var input in form_data) {
var fldName = form_data[input]['name'];
var element = $('#' + fldName);
var msg = $(element).attr('data-val-required') || '';

if (msg.length > 0) {
var valid = $(element).val().length > 0;
var err_span = $("span[data-valmsg-for='" + fldName + "']");

if (!valid) {
err_span.addClass("field-validation-error");
err_span.text(msg);
is_valid = false;
} else {
err_span.removeClass("field-validation-error");
err_span.text('');
}
}
}

$("#mathForm1").attr('data-ajax-valid', is_valid);

if (!is_valid) {
event.preventDefault();
console.log('Form is NOT valid.');

} else {
console.log('Form is valid.');
}
});
});
</script>

<div id="divMathForm">
<h2>Do Some Math</h2>
@using (Html.BeginForm()) {
@using (Html.BeginForm(null, null, FormMethod.Post, new { id = "mathForm1" })) {
@Html.AntiForgeryToken()
<p>
@theTime
</p>
<table style="width:550px">
<tr>
<td>
@Html.TextBoxFor(x=> x.Number1)
@Html.TextBoxFor(x => x.Number1)
</td>
<td>
/
</td>
<td>
@Html.TextBoxFor(x=> x.Number2)
@Html.TextBoxFor(x => x.Number2)
</td>
<td>
=
</td>
<td>
@Html.TextBoxFor(x=> x.Number3)
@Html.TextBoxFor(x => x.Number3)
</td>
</tr>
</table>
<div>
@Html.ValidationMessageFor(m => m.Number1, "", new { @class = "field-validation-error" })<br />
@Html.ValidationMessageFor(m => m.Number2, "", new { @class = "field-validation-error" })<br />
@Html.ValidationMessageFor(m => m.Number3, "", new { @class = "field-validation-error" })
</div>

<p>
<br>
<input type="submit" class="btn btn-info" value="Submit" />
</p>
<p>
<br />
</p>
}
</div>
2 changes: 1 addition & 1 deletion Northwind/Views/Home/Math.cshtml
Expand Up @@ -50,7 +50,7 @@
UpdateTargetId = "divMathForm",
OnBegin = "__carrotOnAjaxRequestBegin",
OnComplete = "__carrotOnAjaxRequestComplete",
OnFailure = "__carrotOnAjaxRequestFailure",
OnFailure = "__carrotOnAjaxRequestFailureAlert",
OnSuccess = "__carrotOnAjaxRequestSuccess"
}, new { @action = "Math" }, null)) {
<p>
Expand Down
2 changes: 1 addition & 1 deletion Northwind/global.json
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.15",
"version": "8.0.2",
"rollForward": "latestMinor",
"allowPrerelease": false
}
Expand Down
3 changes: 3 additions & 0 deletions PluginCalendarModule/PluginCalendarModule.csproj
Expand Up @@ -52,6 +52,9 @@
<Content Include="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="global.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Properties\launchSettings.json" />
<Content Include="wwwroot\Content\calendar.png" />
<Content Include="wwwroot\Content\calendar1.css" />
Expand Down
7 changes: 7 additions & 0 deletions PluginCalendarModule/global.json
@@ -0,0 +1,7 @@
{
"sdk": {
"version": "8.0.2",
"rollForward": "latestMinor",
"allowPrerelease": false
}
}
4 changes: 3 additions & 1 deletion PluginEventCalendarModule/PluginEventCalendarModule.csproj
Expand Up @@ -62,7 +62,9 @@
<Content Include="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="global.json" />
<Content Include="global.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Properties\launchSettings.json" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion PluginEventCalendarModule/global.json
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.15",
"version": "8.0.2",
"rollForward": "latestMinor",
"allowPrerelease": false
}
Expand Down
3 changes: 3 additions & 0 deletions PluginPhotoGallery/PluginPhotoGallery.csproj
Expand Up @@ -68,6 +68,9 @@
<Content Include="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="global.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Properties\launchSettings.json" />
<Content Include="Views\_ViewImports.cshtml" />
<Content Include="Views\_ViewStart.cshtml" />
Expand Down
7 changes: 7 additions & 0 deletions PluginPhotoGallery/global.json
@@ -0,0 +1,7 @@
{
"sdk": {
"version": "8.0.2",
"rollForward": "latestMinor",
"allowPrerelease": false
}
}

0 comments on commit 24b6e65

Please sign in to comment.