This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://stackoverflow.com/questions/30499199/html5-datalist-to-select-only-predefined-options | |
<script> | |
function peopleCheck(el) | |
{ | |
// nothing is done if no value selected - allow empty | |
if (el.value == "") return; | |
var options = el.list.options; | |
for (var i = 0; i< options.length; i++) { | |
if (el.value == options[i].value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To add a full-email field: | |
Click View > Add Columns | |
In the Show Columns dialog do the following: | |
Click New Column button | |
In the New Column dialog specify a name for the new column |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class N2 { | |
// based on Rick Hopkins MooTools Notify | |
//<button onclick="n2 = new N2({title:'My Title',content:'My body'})">My N2 Notify</button> | |
//<button onclick="n2 = new N2({text:'MyCombined Title::My combined body',classes:['inlineNotice']})">My N2 text Notify</button> | |
//<button onclick="n2 = new N2({text:'MyCombined Title::My combined body',classes:['notify-warn']})">My N2 text Warn</button> | |
//<button onclick="n2 = new N2({text:'MyCombined Title::My combined body',classes:['notify-alert']})">My N2 text Alert</button> | |
constructor (opts) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ConsentX { | |
// based on Creare's 'Implied Consent' EU Cookie Law Banner v:2.4 | |
// Conceived by Robert Kent, James Bavington & Tom Foyster | |
constructor () { | |
this.dropCookie = true; // false disables the cookie, allowing you to style the banner | |
this.cookieDuration = 14; // days before the cookie expires, and the banner reappears | |
this.cookieName = 'complianceCookie'; // name of our cookie | |
this.cookieValue = 'on'; // initial value of cookie |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class QF2 { | |
// based on MooTools QuickForm, created by Rick Hopkins | |
//<button onclick="QF = new QF2({title:'This is a Title',content:'Hello'});">QF Content</button> | |
//<button onclick="QF = new QF2({title:'This is a Title',url:'https://testing0.micore.us/qf2/form.html'});">QF Url</button> | |
//<button onclick="QF = new QF2({title:'This is a Title',url:'https://testing0.micore.us/qf2/form.html',data:{key:'value'}});">QF Url with Post Data</button> | |
constructor (opts) { | |
// clear all previously made QuickForms | |
var qf = document.querySelector('.quickform'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://stackoverflow.com/questions/63460485/exporting-html-to-word | |
<script> | |
//<![CDATA[ | |
function Export2Doc(element, filename = ''){ | |
var preHtml = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:w='urn:schemas-microsoft-com:office:word' xmlns='http://www.w3.org/TR/REC-html40'><head> <meta charset='utf-8'><title>Export HTML To Doc</title></head><body>"; | |
var postHtml = "</body></html>"; | |
var html = preHtml+document.getElementById(element).innerHTML+postHtml; | |
var blob = new Blob(['\ufeff', html], { | |
type: 'application/msword' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p>https://stackoverflow.com/questions/30058927/format-a-phone-number-as-a-user-types-using-pure-javascript</p> | |
<input id="phoneNumber" placeholder="Phone Number" maxlength="16" /> | |
<script> | |
isNumericInput = (event) => { | |
const key = event.keyCode; | |
return ((key >= 48 && key <= 57) || // Allow number line | |
(key >= 96 && key <= 105) // Allow number pad |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
//<![CDATA[ | |
//open or close details elements based on viewport | |
function openDesktopDetails() | |
{ | |
const detailsEls = document.querySelectorAll(".wpc details"); | |
var len = detailsEls.length; | |
var w = window.innerWidth; | |
if(w > 1023) { | |
detailsEls.forEach(function (item) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GIMP PSD Layers to PNG | |
Export it as Open Raster (.ora), an open specification for layered-image files. | |
Export Image as Open Raster (.ora) | |
File -> Export As ... | |
myfile.ora | |
Open myfile.ora as an archive, with a program like file-roller or 7zip. | |
https://askubuntu.com/questions/485917/gimp-export-every-layer-as-a-separate-png-image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://stackoverflow.com/questions/187619/is-there-a-javascript-solution-to-generating-a-table-of-contents-for-a-page | |
window.onload = function () { | |
var toc = ""; | |
var level = 0; | |
document.getElementById("VNAArticle").innerHTML = | |
document.getElementById("VNAArticle").innerHTML.replace( | |
/<h([\d])>([^<]+)<\/h([\d])>/gi, | |
function (str, openLevel, titleText, closeLevel) { |
NewerOlder