Sha256: 03eaad440932eacdcddf37ca319caeb5bceaa93dd12a6bf1254934d81b63f712
Contents?: true
Size: 1.81 KB
Versions: 31
Compression:
Stored size: 1.81 KB
Contents
/* # ----------------------------------------------------------------------------- # ~/assets/themes/j1/modules/mdiPreviewer/css/previewer.js # Provides JS functions for the MDI Icon Previewer # # Product/Info: # https://jekyll.one # # Copyright (C) 2021 Juergen Adams # # J1 Template is licensed under the MIT License. # See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE # ----------------------------------------------------------------------------- */ (function(){var a={};var c="/assets/data/mdi_icons.json";function b(){return $.ajax({url:c,success:function(d){if(typeof d=="string"){a=JSON.parse(d)}if(typeof d=="object"){a=d}}})}$.when(b()).done(function(h){a.push({name:"blank",codepoint:"F068C"});var k=function(m){var j=document.createElement("textarea");j.setAttribute("style","position:fixed;opacity:0;top:100px;left:100px;");j.value=m;document.body.appendChild(j);j.select();document.execCommand("copy");var i=document.createElement("div");i.setAttribute("class","copied");i.appendChild(document.createTextNode("Copied to Clipboard"));document.body.appendChild(i);setTimeout(function(){document.body.removeChild(j);document.body.removeChild(i)},1500)};for(var d=0;d<a.length;d++){var l=document.createElement("div"),e=document.createElement("i");l.setAttribute("id","mdi-icon");e.className="mdi mdi-"+a[d].name;l.appendChild(e);var g=document.createElement("code");g.appendChild(document.createTextNode("#"+a[d].codepoint));l.appendChild(g);var f=document.createElement("span");f.appendChild(document.createTextNode(a[d].name));l.appendChild(f);e.onmouseup=(function(i){return function(){k(i.name)}})(a[d]);g.onmouseup=(function(i){return function(){k("#"+i.codepoint)}})(a[d]);f.onmouseup=(function(i){return function(){k("mdi-"+i.name)}})(a[d]);document.getElementById("mdi-icons").appendChild(l)}})})();
Version data entries
31 entries across 31 versions & 1 rubygems