diff --git a/MP-Tablet/About.aspx b/MP-Tablet/About.aspx index a2b04b10..d756bada 100644 --- a/MP-Tablet/About.aspx +++ b/MP-Tablet/About.aspx @@ -116,7 +116,7 @@
-
Browser size data
+
Windows size data
<%--3 days ago--%>

@@ -124,6 +124,26 @@

<%--Donec id elit non mi porta.--%>
+
+
+
Screen size data
+ <%--3 days ago--%> +
+

+

<%: paretoScreenSize %>
+

+ <%--Donec id elit non mi porta.--%> +
+
+
+
Pixel Ratio + Windows size data
+ <%--3 days ago--%> +
+

+

<%: paretoWinPixRat %>
+

+ <%--Donec id elit non mi porta.--%> +
diff --git a/MP-Tablet/About.aspx.cs b/MP-Tablet/About.aspx.cs index c1fce8d7..19000aa3 100644 --- a/MP-Tablet/About.aspx.cs +++ b/MP-Tablet/About.aspx.cs @@ -74,7 +74,7 @@ namespace MoonProTablet lblOut.Text = testo; } /// - /// Restitusice l'elenco pareto (decrescente) delle dimensioni browser registrate + /// Restitusice l'elenco pareto (decrescente) delle dimensioni FINESTRA browser registrate /// public string paretoBrowserSize { @@ -95,6 +95,48 @@ namespace MoonProTablet } } /// + /// Restitusice l'elenco pareto (decrescente) delle dimensioni SCHERMO registrate + /// + public string paretoScreenSize + { + get + { + StringBuilder sb = new StringBuilder(); + string redHash = memLayer.ML.redHash("COUNT:scr:*"); + int numRec = memLayer.ML.redCountKey(redHash); + List> kvp = memLayer.ML.redGetCounterByKey(redHash, memLayer.kvpOrderBy.ValDesc); + // riordino elenco + + sb.AppendLine(string.Format("Trovate {0} combinazioni", numRec)); + foreach (var item in kvp) + { + sb.AppendLine(string.Format("{0}: {1}", item.Key.Replace(memLayer.ML.redHash("COUNT:scr:"), ""), item.Value)); + } + return sb.ToString(); + } + } + /// + /// Restitusice l'elenco pareto (decrescente) delle dimensioni FINESTRA browser + PIXEL ratio registrate + /// + public string paretoWinPixRat + { + get + { + StringBuilder sb = new StringBuilder(); + string redHash = memLayer.ML.redHash("COUNT:wpr:*"); + int numRec = memLayer.ML.redCountKey(redHash); + List> kvp = memLayer.ML.redGetCounterByKey(redHash, memLayer.kvpOrderBy.ValDesc); + // riordino elenco + + sb.AppendLine(string.Format("Trovate {0} combinazioni", numRec)); + foreach (var item in kvp) + { + sb.AppendLine(string.Format("{0}: {1}", item.Key.Replace(memLayer.ML.redHash("COUNT:wpr:"), ""), item.Value)); + } + return sb.ToString(); + } + } + /// /// Formatta un numero da int a size in Kb/Mb/Gb/Tb /// /// diff --git a/MP-Tablet/Scripts/BrowserWindowSize.js b/MP-Tablet/Scripts/BrowserWindowSize.js index bd693302..70c4a024 100644 --- a/MP-Tablet/Scripts/BrowserWindowSize.js +++ b/MP-Tablet/Scripts/BrowserWindowSize.js @@ -8,11 +8,23 @@ function SetWidthHeight() { //var height = $(window).height(); //var width = $(window).width(); //$(window).innerHeight() * $(window).devicePixelRatio(); + + //w = window.screen.width; + //h = window.screen.height; + //if (window.devicePixelRatio < 1) { + // w = window.screen.width / window.devicePixelRatio; + // h = window.screen.height / window.devicePixelRatio; + //} + + $.ajax({ url: "./windowSize.ashx", data: { 'Height': height, - 'Width': width + 'Width': width, + 'PixRat': devicePixelRatio, + 'scrWidth': screen.width, + 'scrHeight': screen.height }, contentType: "application/json; charset=utf-8", dataType: "json" diff --git a/MP-Tablet/windowSize.ashx.cs b/MP-Tablet/windowSize.ashx.cs index 2521211c..5ea2b9ba 100644 --- a/MP-Tablet/windowSize.ashx.cs +++ b/MP-Tablet/windowSize.ashx.cs @@ -24,14 +24,25 @@ namespace MoonProTablet var output = json.Serialize(new { isFirst = context.Session["BrowserWidth"] == null }); context.Response.Write(output); - context.Session["BrowserWidth"] = context.Request.QueryString["Width"]; - context.Session["BrowserHeight"] = context.Request.QueryString["Height"]; + string Width = context.Request.QueryString["Width"]; + string Height = context.Request.QueryString["Height"]; + string scrWidth = context.Request.QueryString["scrWidth"]; + string scrHeight = context.Request.QueryString["scrHeight"]; + string PixRat = context.Request.QueryString["PixRat"]; + context.Session["BrowserWidth"] = Width; + context.Session["BrowserHeight"] = Height; // salva in REDIS come conteggio INCREMENTALE... if (memLayer.ML.CRB("RedEnab")) { - string memName = string.Format("COUNT:wh:{0}x{1}", context.Request.QueryString["Width"], context.Request.QueryString["Height"]); + string memName = string.Format("COUNT:wh:{0}x{1}", Width, Height); // conto +1 x la size nel contatore REDIS long nCall = memLayer.ML.setRCntI(memLayer.ML.redHash(memName)); + // conto anche SCHERMO... + memName = string.Format("COUNT:scr:{0}x{1}", scrWidth, scrHeight); + nCall = memLayer.ML.setRCntI(memLayer.ML.redHash(memName)); + // salvo la PIXEL RATIO con WINDOWS... + memName = string.Format("COUNT:wpr:[{2}] {0}x{1}", Width, Height, PixRat); + nCall = memLayer.ML.setRCntI(memLayer.ML.redHash(memName)); } }