From 89eb47cacc4b4999b62d33bf5b375fe38bee0101 Mon Sep 17 00:00:00 2001 From: MatCat Date: Thu, 11 Mar 2021 00:09:52 -0800 Subject: [PATCH] 0.4.7: Save files now compress, settings are now persistent, added help window, outputs now lilight when hovered over, fixed keybinding bug in textboxes --- README.md | 10 +++++ css/main.css | 75 ++++++++++++++++++++++++++++--- index.html | 36 +++++++++++++-- js/elements.js | 9 +++- js/globalfunctions.js | 71 +++++++++++++++++++++++++++++ js/logicengine.js | 24 +++++++++- js/main.js | 28 ++++++++---- js/vendor/lz-string.min.js | 1 + js/vendor/modernizr-3.11.2.min.js | 3 -- 9 files changed, 234 insertions(+), 23 deletions(-) create mode 100644 js/vendor/lz-string.min.js delete mode 100644 js/vendor/modernizr-3.11.2.min.js diff --git a/README.md b/README.md index 8023742..607ff2d 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,18 @@ This simulator is in extremely early stages, it is not even Alpha at this point To be decided, but at this moment this code is open source and free to use for non-commercial uses. +LZ-String, Copyright 2013 pieroxy under MIT license https://github.com/pieroxy/lz-string/blob/master/LICENSE + ## Changelog +### 0.4.7 + +* Added LZW compression to save files (can be disabled on save) +* Settings are now saved persistently +* Added a basic help window, accessible via the top menu Help->Help, or pressing F1. +* Hovering over an output will now hilight the links from it +* Fixed a bug where keybindings could conflict while typing in textboxes + ### 0.4.6 * Added a new keybinding system, and added many keyboard shortcuts (look in menu) diff --git a/css/main.css b/css/main.css index b33031f..36e57a7 100644 --- a/css/main.css +++ b/css/main.css @@ -283,10 +283,10 @@ textarea { background-color: #54545d; } -#inner-left-menu::-webkit-scrollbar { +#inner-left-menu::-webkit-scrollbar, #HelpWindowContent::-webkit-scrollbar { width: 12px; } -#inner-left-menu::-webkit-scrollbar-track { +#inner-left-menu::-webkit-scrollbar-track, #HelpWindowContent::-webkit-scrollbar-track { /* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#575a60+0,292b2d+14,000000+49,292b2d+82,575a60+100 */ background: rgb(87,90,96); /* Old browsers */ background: -moz-linear-gradient(left, rgba(87,90,96,1) 0%, rgba(41,43,45,1) 14%, rgba(0,0,0,1) 49%, rgba(41,43,45,1) 82%, rgba(87,90,96,1) 100%); /* FF3.6-15 */ @@ -295,7 +295,7 @@ textarea { filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#575a60', endColorstr='#575a60',GradientType=1 ); /* IE6-9 */ } -#inner-left-menu::-webkit-scrollbar-thumb { +#inner-left-menu::-webkit-scrollbar-thumb, #HelpWindowContent::-webkit-scrollbar-thumb { /* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#000000+0,000000+50,000000+50,8e8e8e+50,000000+100&0+0,1+50,0+100 */ background: -moz-linear-gradient(left, rgba(0,0,0,0) 0%, rgba(142,142,142,1) 50%, rgba(0,0,0,0) 100%); /* FF3.6-15 */ background: -webkit-linear-gradient(left, rgba(0,0,0,0) 0%,rgba(142,142,142,1) 50%,rgba(0,0,0,0) 100%); /* Chrome10-25,Safari5.1-6 */ @@ -354,6 +354,34 @@ textarea { } +.CloseWindow:hover { + /* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#efc5ca+0,d24b5a+50,ba2737+51,f18e99+100;Red+Gloss+%233 */ + background: rgb(239,197,202); /* Old browsers */ + background: -moz-linear-gradient(top, rgba(239,197,202,1) 0%, rgba(210,75,90,1) 50%, rgba(186,39,55,1) 51%, rgba(241,142,153,1) 100%); /* FF3.6-15 */ + background: -webkit-linear-gradient(top, rgba(239,197,202,1) 0%,rgba(210,75,90,1) 50%,rgba(186,39,55,1) 51%,rgba(241,142,153,1) 100%); /* Chrome10-25,Safari5.1-6 */ + background: linear-gradient(to bottom, rgba(239,197,202,1) 0%,rgba(210,75,90,1) 50%,rgba(186,39,55,1) 51%,rgba(241,142,153,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#efc5ca', endColorstr='#f18e99',GradientType=0 ); /* IE6-9 */ + +} + +.CloseWindow { + cursor: default; + float: right; + margin-right: 10px; + font-family: Calibri; + border-radius: 5px; + margin: 3px; + width: 1em; + font-size: 0.8em; + + /* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#f85032+0,f16f5c+50,f6290c+51,f02f17+71,e73827+100;Red+Gloss+%231 */ + background: rgb(248,80,50); /* Old browsers */ + background: -moz-linear-gradient(top, rgba(248,80,50,1) 0%, rgba(241,111,92,1) 50%, rgba(246,41,12,1) 51%, rgba(240,47,23,1) 71%, rgba(231,56,39,1) 100%); /* FF3.6-15 */ + background: -webkit-linear-gradient(top, rgba(248,80,50,1) 0%,rgba(241,111,92,1) 50%,rgba(246,41,12,1) 51%,rgba(240,47,23,1) 71%,rgba(231,56,39,1) 100%); /* Chrome10-25,Safari5.1-6 */ + background: linear-gradient(to bottom, rgba(248,80,50,1) 0%,rgba(241,111,92,1) 50%,rgba(246,41,12,1) 51%,rgba(240,47,23,1) 71%,rgba(231,56,39,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f85032', endColorstr='#e73827',GradientType=0 ); /* IE6-9 */ +} + #darkout-overlay { position: absolute; left: 0px; @@ -415,6 +443,43 @@ textarea { border: 1px solid black; z-index: 999; } + +#HelpWindow { + width: 60vw; + height: 60vh; +} + +.HelpZone { + background-color: rgba(255,255,255,0.1); + margin: 1rem; +} + +.HelpZone h2 { + background-color: #222222; + padding-left: 10px; +} + +.HelpZone h3 { + padding-left: 10px; + border-bottom: 1px inset #444; + padding-bottom: 5px; + margin-bottom: 5px; + color: #eeffff; +} + + +.HelpZone p { + padding: 5px; + margin-top: 5px; +} + +#HelpWindowContent { + margin: auto; + width: 100%; + height: 93%; + overflow-y: auto; +} + #CreateICBox { width: 400px; height: 300px; @@ -427,7 +492,7 @@ textarea { #SaveWindow { width: 350px; - height: 120px; + height: 140px; } #SaveWindowContent { @@ -436,7 +501,7 @@ textarea { margin-top: 10px; } -#PropertiesBoxTitle, #CreateICBoxTitle, #SaveWindowTitle { +#PropertiesBoxTitle, #CreateICBoxTitle, #SaveWindowTitle, #HelpWindowTitle { text-align: center; background-color: #222222; font-size: 1.5em; diff --git a/index.html b/index.html index 6233bbb..4106bf9 100644 --- a/index.html +++ b/index.html @@ -59,7 +59,7 @@
  • Delete
  • Disconnect
  • -
  • Select All
  • +
  • Select All
  • @@ -89,6 +89,8 @@
  • Help
      +
    • Help
    • +
    • GIT Repo
    • About
    • @@ -144,6 +146,9 @@
      Design Name
      +
      + Save Compressed +
         
      @@ -152,12 +157,37 @@
      MatCat Logic Engine Help +
      X
      -
      - +
      +
      +

      Basic Concept

      +

      Signal Propagation

      +

      This engine simulates digital logic conceptually, it does not try to perfectly emulate real world devices, I.E. there is no impedance, propagation delay simulation, and the like. However it does try to simulate high/low as realistic as it can, so for example if you have multiple outputs connected to a single input, if any of them are high, that input will see high, it will not go low until ALL connections to it have gone low, this does somewhat mimic the idea of a tristate, and allows for using connections at bus points, as well as line level OR.

      +

      Simulation Speed

      +

      Logic signals are allowed to flow as fast as the javascript interpreter can run the code, when using IC's input and outputs ARE buffered, which means they will have a propagation delay of the shortest possible javascript timing, which on most browsers is 4ms. Using a buffer element would have the same delay time as an IC I/O.

      +
      +
      +

      Linking

      +

      You can only link from an output to an input, to do so click on an output, a dashed line will now follow your mouse, click on an input of another element to finish the link.

      +

      To delete a link simply do the same thing you did to connect the link and it will disconnect that link.

      +
      +
      +

      IC's

      +

      Concept

      +

      The IC functionality is a core powerful function of this engine as it allows you to design a circuit and turn it into a single self contained element you can use in other designs, including inside of OTHER IC's. IC's are unique only in that you must place input and output elements to interface to the IC. The Input and Output elements you place will determine what pins are shown on the IC when created. Note that IC Input and Outputs are buffered connections.

      +

      Creating

      +

      To create an IC the minimal needed circuitry is atleast 1 IC Output in the design, once you have a design you wish to turn into an IC you can do so either via the top menu Tools->Create IC, or the right click menu Create IC option, or keyboard shortcut (default ctrl+c). This will open a dialog box where you can name and describe your IC. Once it is created it will appear in the left hand toolbox under the IC's category.

      +
      +
      +

      Work Area

      +

      Panning

      +

      You can pan the design by holding control key while clicking and dragging with the left mouse button on unoccupied space.

      +
      + diff --git a/js/elements.js b/js/elements.js index ee33f08..f09a7e6 100644 --- a/js/elements.js +++ b/js/elements.js @@ -366,6 +366,7 @@ class Element extends CanvasTools { let firstY = (centerY - (totalHeight/2)) + 12; for (let a = 0; a < this.OutputConnections.length;a++) { + let mouseDist = length2D(this.X+(this.Width - 10), firstY + (this.OutputConnections[a].Output*24),this.MousePosition.x,this.MousePosition.y); if (!this.OutputConnections[a].Container.HasElement(this.OutputConnections[a].Element)) { // This is a ghosted connection, lets get rid of it this.OutputConnections.splice(a,1); @@ -390,13 +391,19 @@ class Element extends CanvasTools { ctx.save(); ctx.beginPath(); ctx.lineWidth = settings.LinkWidth; + if ((mouseDist <= (this.outputCircleRadius)) && !this.LogicEngine.ActiveLink) ctx.lineWidth = (settings.LinkWidth * 2); ctx.setLineDash(settings.LinkDash); ctx.moveTo(startX, startY); //ctx.lineTo(endX, endY); ctx.quadraticCurveTo(startMidX,startMidY,midX,midY); ctx.quadraticCurveTo(endMidX,endMidY,endX,endY); ctx.strokeStyle = settings.ActiveConnectionColor; - if (!this.getOutput(this.OutputConnections[a].Output)) ctx.strokeStyle = settings.InactiveConnectionColor; + if ((mouseDist <= (this.outputCircleRadius)) && !this.LogicEngine.ActiveLink) ctx.strokeStyle = settings.ActiveConnectionHoverColor; + if (!this.getOutput(this.OutputConnections[a].Output)) { + ctx.strokeStyle = settings.InactiveConnectionColor; + if ((mouseDist <= (this.outputCircleRadius)) && !this.LogicEngine.ActiveLink) ctx.strokeStyle = settings.InactiveConnectionHoverColor; + } + ctx.stroke(); ctx.restore(); diff --git a/js/globalfunctions.js b/js/globalfunctions.js index 75a1178..426e5e7 100644 --- a/js/globalfunctions.js +++ b/js/globalfunctions.js @@ -152,6 +152,44 @@ function KeybindToString(binding) { return kbs; } +function BuildTopMenu() { + // Make sure settings are set correct + if (logicEngine.Settings.HideConnections) { + let sgSpan = tfm_ShowConns.getElementsByClassName("checkbox")[0]; + sgSpan.innerHTML = " "; + } else { + let sgSpan = tfm_ShowConns.getElementsByClassName("checkbox")[0]; + sgSpan.innerText = "✓"; + } + if (!logicEngine.Settings.TopConnections) { + tfm_ConnLayer.innerHTML = ' Connections Above'; + } else { + tfm_ConnLayer.innerHTML = ' Connections Below'; + } + if (!logicEngine.Settings.ShowFPS) { + let sgSpan = tfm_ShowFPS.getElementsByClassName("checkbox")[0]; + sgSpan.innerHTML = " "; + } else { + let sgSpan = tfm_ShowFPS.getElementsByClassName("checkbox")[0]; + sgSpan.innerText = "✓"; + } + if (!logicEngine.Settings.ShowGrid) { + let sgSpan = tfm_ShowGrid.getElementsByClassName("checkbox")[0]; + sgSpan.innerHTML = " "; + } else { + let sgSpan = tfm_ShowGrid.getElementsByClassName("checkbox")[0]; + sgSpan.innerText = "✓"; + } + if (!logicEngine.Settings.SnapGrid) { + let sgSpan = tfm_SnapGrid.getElementsByClassName("checkbox")[0]; + sgSpan.innerHTML = " "; + } else { + let sgSpan = tfm_SnapGrid.getElementsByClassName("checkbox")[0]; + sgSpan.innerText = "✓"; + } + in_GridSize.value = logicEngine.Settings.GridSize; +} + function BuildToolbox() { let toolbox = document.getElementById("inner-left-menu"); toolbox.innerHTML = ""; @@ -229,6 +267,26 @@ function disableSelectedRCMs(bool) { } } +function showRCM(evt) { + evt.preventDefault(); + let rcm = document.getElementById("RightClickMenu"); + rcm.style.left = (evt.clientX-40) + "px"; + rcm.style.top = (evt.clientY-25) + "px"; + rcm.style.display = "block"; +} + +function ShowHelp() { + let helpWindow = document.getElementById("HelpWindow"); + helpWindow.style.display = "block"; + helpWindow.style.left = Math.round((window.innerWidth / 2) - (helpWindow.clientWidth/2)) + "px"; + helpWindow.style.top = Math.round((window.innerHeight / 2) - (helpWindow.clientHeight/2)) + "px"; +} + +function HideHelp() { + let helpWindow = document.getElementById("HelpWindow"); + helpWindow.style.display = "none"; +} + function hideMenus() { let tds = document.getElementsByClassName("top-menu-div"); for (let a = 0; a < tds.length; a++) { @@ -237,6 +295,11 @@ function hideMenus() { } +function SaveSettings() { + localStorage.setItem("LogicEngineSettings",JSON.stringify(logicEngine.Settings)); + console.log("Settings Saved"); +} + function createSaveState(container = false) { let saveState = { Name: "LogicDesign", @@ -247,6 +310,13 @@ function createSaveState(container = false) { Elements: new Array() }; if (container.Elements.length > 0) saveState.Elements = container.Elements; + let saveCompressed = document.getElementById("saveCompressed"); + if (saveCompressed.checked) { + saveState.Elements = LZString.compressToUTF16(JSON.stringify(saveState.Elements)); + saveState.Compressed = true; + } else { + saveState.Compressed = false; + } return saveState; } @@ -350,6 +420,7 @@ function loadsave(savedata) { if (!savedata) return 0; if (!savedata.Version) return -1; // TODO: Let the person know invalid save file if (!isVersionNewer(savedata.Version,"0.3.0")) return -2; // TODO: Let the person know the version is too old + if (savedata?.Compressed) savedata.Elements = JSON.parse(LZString.decompressFromUTF16(savedata.Elements)); let newContainer = loadContainer(savedata.Elements); if (!newContainer) return -3; let saveName = document.getElementById("saveName"); diff --git a/js/logicengine.js b/js/logicengine.js index 7f714b4..6bd3083 100644 --- a/js/logicengine.js +++ b/js/logicengine.js @@ -1,7 +1,9 @@ class LogicEngineSettings { - constructor() { + constructor(restoresettings = false) { this.ActiveConnectionColor = "#aabbaa"; + this.ActiveConnectionHoverColor = "#ccffcc"; this.InactiveConnectionColor = "#bbaaaa"; + this.InactiveConnectionHoverColor = "#ffcccc"; this.LinkWidth = "2"; this.LinkDash = []; this.LinkingConnectionColor = "#aabbbb"; @@ -175,6 +177,12 @@ class LogicEngineSettings { */ }; + if (restoresettings) { + let othis = this; + Object.keys(restoresettings).forEach(function(key) { + othis[key] = restoresettings[key]; + }); + } } } @@ -377,6 +385,7 @@ class LogicEngine { this.ControlPressed = true; } + if (document.activeElement.tagName.toLowerCase() == "input") return; // Dont interupt a textbox if (evt.key == "Escape") { if (this.MovingElement && this.MouseDown) { this.MovingElement.X = this.MovingElementStartX; @@ -452,6 +461,11 @@ class LogicEngine { tfm_CreateIC.click(evt); } + if (MatchesPress(this.Settings.Keybindings.Help,evt)) { + evt.preventDefault(); + ShowHelp(); + } + if (MatchesPress(this.Settings.Keybindings.DeleteElements,evt)) { if (this.ActiveContainer.Selected?.length > 0) { @@ -476,7 +490,13 @@ class LogicEngine { this.Canvas = canvas; this.Ctx = canvas.getContext("2d"); - this.Settings = new LogicEngineSettings; + let restoresettings = false; + if (localStorage.getItem("LogicEngineSettings")) { + restoresettings = JSON.parse(localStorage.getItem("LogicEngineSettings")); + console.log("Restoring Settings"); + } + + this.Settings = new LogicEngineSettings(restoresettings); this.FPSCounter = 0; this.FPS = 0; this.PotentialFPS = 0; diff --git a/js/main.js b/js/main.js index 96f6540..b8a3e8e 100644 --- a/js/main.js +++ b/js/main.js @@ -2,7 +2,7 @@ MatCat BrowserLogic Simulator */ -let Version = "0.4.6"; +let Version = "0.4.7"; let spanVersion = document.getElementById("version"); spanVersion.innerText = Version; // get the canvas and get the engine object going @@ -272,6 +272,7 @@ tfm_ShowConns.addEventListener("click", function (evt) { sgSpan.innerHTML = " "; logicEngine.Settings.HideConnections = true; } + SaveSettings(); setTimeout(function(){hideMenus()},10); }); @@ -284,6 +285,7 @@ tfm_ConnLayer.addEventListener("click", function (evt) { tfm_ConnLayer.innerText = "Connections Below"; logicEngine.Settings.TopConnections = true; } + SaveSettings(); setTimeout(function(){hideMenus()},10); }); @@ -298,6 +300,7 @@ tfm_ShowFPS.addEventListener("click", function (evt) { sgSpan.innerText = "✓"; logicEngine.Settings.ShowFPS = true; } + SaveSettings(); logicEngine.Resize(""); setTimeout(function(){hideMenus()},10); }); @@ -322,6 +325,7 @@ tfm_ShowGrid.addEventListener("click", function (evt) { sgSpan.innerText = "✓"; logicEngine.Settings.ShowGrid = true; } + SaveSettings(); logicEngine.Resize(""); setTimeout(function(){hideMenus()},10); }); @@ -337,6 +341,7 @@ tfm_SnapGrid.addEventListener("click", function (evt) { sgSpan.innerText = "✓"; logicEngine.Settings.SnapGrid = true; } + SaveSettings(); logicEngine.Resize(""); setTimeout(function(){hideMenus()},10); }); @@ -345,18 +350,23 @@ let in_GridSize = document.getElementById("in_GridSize"); in_GridSize.addEventListener("change", function (evt) { logicEngine.Settings.GridSize = parseInt(in_GridSize.value); logicEngine.Resize(""); + SaveSettings(); //setTimeout(function(){hideMenus()},10); }); +let tfm_Help = document.getElementById("tfm_Help"); +tfm_Help.addEventListener("click", function (evt) { + setTimeout(function(){hideMenus()},10); + ShowHelp(); +}); -function showRCM(evt) { - evt.preventDefault(); - let rcm = document.getElementById("RightClickMenu"); - rcm.style.left = (evt.clientX-40) + "px"; - rcm.style.top = (evt.clientY-25) + "px"; - rcm.style.display = "block"; -} +let helpWindow = document.getElementById("HelpWindow"); +let helpWindow_Close = helpWindow.getElementsByClassName("CloseWindow")[0]; +helpWindow_Close.addEventListener("click", function (evt) { + HideHelp(); +}); + let leftmenu = document.getElementById("left-menu"); let propwin = document.getElementById("PropertiesBox"); @@ -368,5 +378,5 @@ let topbar = document.getElementById("top-bar"); topbar.addEventListener( "contextmenu", function(evt) { evt.preventDefault(); }); - +BuildTopMenu(); CheckForWelcomeCookie(); diff --git a/js/vendor/lz-string.min.js b/js/vendor/lz-string.min.js new file mode 100644 index 0000000..2d1900a --- /dev/null +++ b/js/vendor/lz-string.min.js @@ -0,0 +1 @@ +var LZString=function(){function o(o,r){if(!t[o]){t[o]={};for(var n=0;ne;e++){var s=r.charCodeAt(e);n[2*e]=s>>>8,n[2*e+1]=s%256}return n},decompressFromUint8Array:function(o){if(null===o||void 0===o)return i.decompress(o);for(var n=new Array(o.length/2),e=0,t=n.length;t>e;e++)n[e]=256*o[2*e]+o[2*e+1];var s=[];return n.forEach(function(o){s.push(r(o))}),i.decompress(s.join(""))},compressToEncodedURIComponent:function(o){return null==o?"":i._compress(o,6,function(o){return e.charAt(o)})},decompressFromEncodedURIComponent:function(r){return null==r?"":""==r?null:(r=r.replace(/ /g,"+"),i._decompress(r.length,32,function(n){return o(e,r.charAt(n))}))},compress:function(o){return i._compress(o,16,function(o){return r(o)})},_compress:function(o,r,n){if(null==o)return"";var e,t,i,s={},p={},u="",c="",a="",l=2,f=3,h=2,d=[],m=0,v=0;for(i=0;ie;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a]}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++),s[c]=f++,a=String(u)}if(""!==a){if(Object.prototype.hasOwnProperty.call(p,a)){if(a.charCodeAt(0)<256){for(e=0;h>e;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a]}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++)}for(t=2,e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;for(;;){if(m<<=1,v==r-1){d.push(n(m));break}v++}return d.join("")},decompress:function(o){return null==o?"":""==o?null:i._decompress(o.length,32768,function(r){return o.charCodeAt(r)})},_decompress:function(o,n,e){var t,i,s,p,u,c,a,l,f=[],h=4,d=4,m=3,v="",w=[],A={val:e(0),position:n,index:1};for(i=0;3>i;i+=1)f[i]=i;for(p=0,c=Math.pow(2,2),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(t=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 2:return""}for(f[3]=l,s=l,w.push(l);;){if(A.index>o)return"";for(p=0,c=Math.pow(2,m),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(l=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 2:return w.join("")}if(0==h&&(h=Math.pow(2,m),m++),f[l])v=f[l];else{if(l!==d)return null;v=s+s.charAt(0)}w.push(v),f[d++]=s+v.charAt(0),h--,s=v,0==h&&(h=Math.pow(2,m),m++)}}};return i}();"function"==typeof define&&define.amd?define(function(){return LZString}):"undefined"!=typeof module&&null!=module&&(module.exports=LZString); diff --git a/js/vendor/modernizr-3.11.2.min.js b/js/vendor/modernizr-3.11.2.min.js deleted file mode 100644 index feada51..0000000 --- a/js/vendor/modernizr-3.11.2.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! modernizr 3.11.2 (Custom Build) | MIT * - * https://modernizr.com/download/?-cssanimations-csscolumns-customelements-flexbox-history-picture-pointerevents-postmessage-sizes-srcset-webgl-websockets-webworkers-addtest-domprefixes-hasevent-mq-prefixedcssvalue-prefixes-setclasses-testallprops-testprop-teststyles !*/ -!function(e,t,n,r){function o(e,t){return typeof e===t}function i(e){var t=_.className,n=Modernizr._config.classPrefix||"";if(S&&(t=t.baseVal),Modernizr._config.enableJSClass){var r=new RegExp("(^|\\s)"+n+"no-js(\\s|$)");t=t.replace(r,"$1"+n+"js$2")}Modernizr._config.enableClasses&&(e.length>0&&(t+=" "+n+e.join(" "+n)),S?_.className.baseVal=t:_.className=t)}function s(e,t){if("object"==typeof e)for(var n in e)k(e,n)&&s(n,e[n]);else{e=e.toLowerCase();var r=e.split("."),o=Modernizr[r[0]];if(2===r.length&&(o=o[r[1]]),void 0!==o)return Modernizr;t="function"==typeof t?t():t,1===r.length?Modernizr[r[0]]=t:(!Modernizr[r[0]]||Modernizr[r[0]]instanceof Boolean||(Modernizr[r[0]]=new Boolean(Modernizr[r[0]])),Modernizr[r[0]][r[1]]=t),i([(t&&!1!==t?"":"no-")+r.join("-")]),Modernizr._trigger(e,t)}return Modernizr}function a(){return"function"!=typeof n.createElement?n.createElement(arguments[0]):S?n.createElementNS.call(n,"http://www.w3.org/2000/svg",arguments[0]):n.createElement.apply(n,arguments)}function l(){var e=n.body;return e||(e=a(S?"svg":"body"),e.fake=!0),e}function u(e,t,r,o){var i,s,u,f,c="modernizr",d=a("div"),p=l();if(parseInt(r,10))for(;r--;)u=a("div"),u.id=o?o[r]:c+(r+1),d.appendChild(u);return i=a("style"),i.type="text/css",i.id="s"+c,(p.fake?p:d).appendChild(i),p.appendChild(d),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(n.createTextNode(e)),d.id=c,p.fake&&(p.style.background="",p.style.overflow="hidden",f=_.style.overflow,_.style.overflow="hidden",_.appendChild(p)),s=t(d,e),p.fake?(p.parentNode.removeChild(p),_.style.overflow=f,_.offsetHeight):d.parentNode.removeChild(d),!!s}function f(e,n,r){var o;if("getComputedStyle"in t){o=getComputedStyle.call(t,e,n);var i=t.console;if(null!==o)r&&(o=o.getPropertyValue(r));else if(i){var s=i.error?"error":"log";i[s].call(i,"getComputedStyle returning null, its possible modernizr test results are inaccurate")}}else o=!n&&e.currentStyle&&e.currentStyle[r];return o}function c(e,t){return!!~(""+e).indexOf(t)}function d(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function p(e,n){var o=e.length;if("CSS"in t&&"supports"in t.CSS){for(;o--;)if(t.CSS.supports(d(e[o]),n))return!0;return!1}if("CSSSupportsRule"in t){for(var i=[];o--;)i.push("("+d(e[o])+":"+n+")");return i=i.join(" or "),u("@supports ("+i+") { #modernizr { position: absolute; } }",function(e){return"absolute"===f(e,null,"position")})}return r}function m(e){return e.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")}function h(e,t,n,i){function s(){u&&(delete N.style,delete N.modElem)}if(i=!o(i,"undefined")&&i,!o(n,"undefined")){var l=p(e,n);if(!o(l,"undefined"))return l}for(var u,f,d,h,A,v=["modernizr","tspan","samp"];!N.style&&v.length;)u=!0,N.modElem=a(v.shift()),N.style=N.modElem.style;for(d=e.length,f=0;f