Inclusione pacchetti js in progetto SMART

This commit is contained in:
Samuele E. Locatelli
2020-09-03 16:51:09 +02:00
parent d9aa66db80
commit 2d92c9b2b8
15 changed files with 39778 additions and 103 deletions
+39 -35
View File
@@ -3,51 +3,55 @@ using System.Web.UI;
namespace GPW_Smart
{
public class BundleConfig
{
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkID=303951
public static void RegisterBundles(BundleCollection bundles)
public class BundleConfig
{
bundles.Add(new ScriptBundle("~/bundles/WebFormsJs").Include(
"~/Scripts/WebForms/WebForms.js",
"~/Scripts/WebForms/WebUIValidation.js",
"~/Scripts/WebForms/MenuStandards.js",
"~/Scripts/WebForms/Focus.js",
"~/Scripts/WebForms/GridView.js",
"~/Scripts/WebForms/DetailsView.js",
"~/Scripts/WebForms/TreeView.js",
"~/Scripts/WebForms/WebParts.js"));
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkID=303951
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/WebFormsJs").Include(
"~/Scripts/WebForms/WebForms.js",
"~/Scripts/WebForms/WebUIValidation.js",
"~/Scripts/WebForms/MenuStandards.js",
"~/Scripts/WebForms/Focus.js",
"~/Scripts/WebForms/GridView.js",
"~/Scripts/WebForms/DetailsView.js",
"~/Scripts/WebForms/TreeView.js",
"~/Scripts/WebForms/WebParts.js"));
// Order is very important for these files to work, they have explicit dependencies
bundles.Add(new ScriptBundle("~/bundles/MsAjaxJs").Include(
"~/Scripts/WebForms/MsAjax/MicrosoftAjax.js",
"~/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js",
"~/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js",
"~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js"));
// Order is very important for these files to work, they have explicit dependencies
bundles.Add(new ScriptBundle("~/bundles/MsAjaxJs").Include(
"~/Scripts/WebForms/MsAjax/MicrosoftAjax.js",
"~/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js",
"~/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js",
"~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js"));
// Use the Development version of Modernizr to develop with and learn from. Then, when youre
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
// Use the Development version of Modernizr to develop with and learn from. Then, when youre
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
"~/Scripts/jquery-ui-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
"~/Scripts/jquery-ui-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jSteamware").Include(
"~/Scripts/jSteamware*"));
bundles.Add(new ScriptBundle("~/bundles/jSteamware").Include(
"~/Scripts/jSteamware*"));
bundles.Add(new ScriptBundle("~/bundles/jsChart").Include(
"~/Scripts/Chart.js"));
bundles.Add(new ScriptBundle("~/bundles/jsMoment").Include(
"~/Scripts/moment.js"));
//// aggiungo bundle dinamico x less --> css
//bundles.Add(new DynamicFolderBundle("less", "*.less"));
//// aggiungo bundle dinamico x less --> css
//bundles.Add(new DynamicFolderBundle("less", "*.less"));
// abilito boundle "forzato"!
BundleTable.EnableOptimizations = true;
;
// abilito boundle "forzato"!
BundleTable.EnableOptimizations = true;
;
}
}
}
}
+47
View File
@@ -0,0 +1,47 @@
/*
* DOM element rendering detection
* https://davidwalsh.name/detect-node-insertion
*/
@keyframes chartjs-render-animation {
from { opacity: 0.99; }
to { opacity: 1; }
}
.chartjs-render-monitor {
animation: chartjs-render-animation 0.001s;
}
/*
* DOM element resizing detection
* https://github.com/marcj/css-element-queries
*/
.chartjs-size-monitor,
.chartjs-size-monitor-expand,
.chartjs-size-monitor-shrink {
position: absolute;
direction: ltr;
left: 0;
top: 0;
right: 0;
bottom: 0;
overflow: hidden;
pointer-events: none;
visibility: hidden;
z-index: -1;
}
.chartjs-size-monitor-expand > div {
position: absolute;
width: 1000000px;
height: 1000000px;
left: 0;
top: 0;
}
.chartjs-size-monitor-shrink > div {
position: absolute;
width: 200%;
height: 200%;
left: 0;
top: 0;
}
+1
View File
@@ -0,0 +1 @@
@keyframes chartjs-render-animation{from{opacity:.99}to{opacity:1}}.chartjs-render-monitor{animation:chartjs-render-animation 1ms}.chartjs-size-monitor,.chartjs-size-monitor-expand,.chartjs-size-monitor-shrink{position:absolute;direction:ltr;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1}.chartjs-size-monitor-expand>div{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}
+10
View File
@@ -226,6 +226,8 @@
<Content Include="Content\bootstrap-reboot.min.css" />
<Content Include="Content\bootstrap.css" />
<Content Include="Content\bootstrap.min.css" />
<Content Include="Content\Chart.css" />
<Content Include="Content\Chart.min.css" />
<Content Include="Content\font-awesome.css" />
<Content Include="Content\font-awesome.min.css" />
<Content Include="Content\fonts.css">
@@ -498,6 +500,12 @@
<Content Include="logs\PlaceHolder.file" />
<Content Include="App_Readme\SteamWare_demo\example-NLog.config" />
<Content Include="App_Readme\SteamWare_demo\example-app.config" />
<Content Include="Scripts\Chart.js" />
<Content Include="Scripts\Chart.min.js" />
<Content Include="Scripts\moment-with-locales.js" />
<Content Include="Scripts\moment-with-locales.min.js" />
<Content Include="Scripts\moment.js" />
<Content Include="Scripts\moment.min.js" />
<Content Include="Test.aspx" />
<Content Include="WebUserControls\cmp_chart.ascx" />
<None Include="compilerconfig.json" />
@@ -701,6 +709,8 @@
<Content Include="Scripts\popper.js.map" />
<Content Include="Scripts\popper-utils.min.js.map" />
<Content Include="Scripts\popper-utils.js.map" />
<Content Include="Scripts\moment.min.js.map" />
<Content Include="Scripts\moment-with-locales.min.js.map" />
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>
+16151
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2
View File
@@ -24,6 +24,8 @@
<asp:PlaceHolder runat="server">
<%: Scripts.Render("~/bundles/modernizr") %>
<%: Scripts.Render("~/bundles/jsChart") %>
<%: Scripts.Render("~/bundles/jsMoment") %>
</asp:PlaceHolder>
<webopt:BundleReference runat="server" Path="~/Content/css" />
+88 -68
View File
@@ -1,88 +1,108 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_chart.ascx.cs" Inherits="GPW_Smart.WebUserControls.cmp_chart" %>
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0"></script>
<canvas id="myChart"></canvas>
<asp:HiddenField runat="server" ID="hfIdxDip" />
<asp:HiddenField runat="server" ID="hfData" />
<script>
var ctx = document.getElementById('myChart').getContext('2d');
var chart = new Chart(ctx, {
// The type of chart we want to create
type: 'line',
// The data for our dataset
data: {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [{
label: 'My First dataset',
//backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)',
data: [0, 10, 5, 2, 20, 30, 45]
}]
},
// Configuration options go here
options: {}
});
</script>
<%--<script>
// funzione eseguita se successo al caricamento
function OnSuccess_(reponse) {
// recupero obj chart
var ctx = document.getElementById("myChart");
var myOptions = {
scales: {
xAxes: [{
type: 'time',
distribution: 'series'
}]
}
//responsive: true,
//maintainAspectRatio: true,
//scale: {
// ticks: {
// beginAtZero: true,
// max: 42,
// min: 33
// }
//},
//animation: {
// duration: 0
//},
//legend: {
// display: false
//}
};
// recupero dati restituiti
var dataTS = reponse.d;
var myLineChart = new Chart(ctx, {
type: 'scatter',
// recupero obj chart
var ctx = document.getElementById('myChart').getContext('2d');
var chart = new Chart(ctx, {
//type: 'line',
//data: dataTS,
data: [{
x: -10,
y: 0
}, {
x: 0,
y: 10
}, {
x: 10,
y: 5
}],
type: 'scatter',
data: {
datasets: [{
label: 'Temp Rilevata',
//data = dataTS
data: [
//{ x: 0, y: 36.5 },
//{ x: 1, y: 35.5 },
//{ x: 2, y: 36.1 },
//{ x: 3, y: 36.2 },
//{ x: 4, y: 36.0 }
{ x: new Date('2020-08-10T00:00:00'), y: 36.5 },
{ x: new Date('2020-08-15T00:00:00'), y: 35.5 },
{ x: new Date('2020-08-22T00:00:00'), y: 36.1 },
{ x: new Date('2020-08-23T00:00:00'), y: 36.2 },
{ x: new Date('2020-08-29T00:00:00'), y: 36.0 }
//{ x: '2020-08-20T00:00:00', y: 36.5 },
//{ x: '2020-08-21T00:00:00', y: 35.5 },
//{ x: '2020-08-22T00:00:00', y: 36.1 },
//{ x: '2020-08-23T00:00:00', y: 36.2 },
//{ x: '2020-08-24T00:00:00', y: 36.0 }
]
}]
},
options: {
scales: {
xAxes: [{
type: 'linear',
position: 'bottom'
//type: 'time',
//time: {
// unit: 'day'
//}
}]
}
}
//options: myOptions
});
//var myOptions = {
// scales: {
// xAxes: [{
// type: 'time',
// distribution: 'series'
// }]
// }
// //responsive: true,
// //maintainAspectRatio: true,
// //scale: {
// // ticks: {
// // beginAtZero: true,
// // max: 42,
// // min: 33
// // }
// //},
// //animation: {
// // duration: 0
// //},
// //legend: {
// // display: false
// //}
//};
//var dataTS = reponse.d;
//var myLineChart = new Chart(ctx, {
// type: 'scatter',
// //type: 'line',
// //data: dataTS,
// data: [{
// x: -10,
// y: 0
// }, {
// x: 0,
// y: 10
// }, {
// x: 10,
// y: 5
// }],
// options: {
// scales: {
// xAxes: [{
// type: 'linear',
// position: 'bottom'
// }]
// }
// }
// //options: myOptions
//});
}
// errore in reload!
function OnErrorCall_(repo) {
@@ -93,8 +113,7 @@
// caricamento pagina
$.ajax({
type: "GET",
url: "api/TempRil/1",
////url: "api/TempRil/<%=hfIdxDip.Value %>",
url: "api/TempRil/<%=hfIdxDip.Value %>",
//data: "{ dataRif: '<%=hfData.Value%>', numRec: 0 }",
contentType: "application/json; charset=utf-8",
dataType: "json",
@@ -105,6 +124,7 @@
// funzione di drawing ad OGNI pageload!
function pageLoad() {
// chiamo recupero dati + plot
plotTS();
}
</script>--%>
</script>
+2
View File
@@ -6,6 +6,7 @@
<package id="AspNet.ScriptManager.bootstrap" version="4.4.1" targetFramework="net462" />
<package id="AspNet.ScriptManager.jQuery" version="3.4.1" targetFramework="net462" />
<package id="bootstrap" version="4.4.1" targetFramework="net462" />
<package id="Chart.js" version="2.9.3" targetFramework="net462" />
<package id="Crc32C.NET" version="1.0.5.0" targetFramework="net462" />
<package id="DnsClient" version="1.3.1" targetFramework="net462" />
<package id="elmah" version="1.2.2" targetFramework="net462" />
@@ -33,6 +34,7 @@
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net462" />
<package id="Microsoft.Web.RedisSessionStateProvider" version="4.0.1" targetFramework="net462" />
<package id="Modernizr" version="2.8.3" targetFramework="net462" />
<package id="Moment.js" version="2.27.0" targetFramework="net462" />
<package id="MongoDB.Bson" version="2.10.3" targetFramework="net462" />
<package id="MongoDB.Driver" version="2.10.3" targetFramework="net462" />
<package id="MongoDB.Driver.Core" version="2.10.3" targetFramework="net462" />