Skip to content

Instantly share code, notes, and snippets.

@max19931
max19931 / index.html
Last active August 20, 2019 10:35
WYSIWYG
<html>
<body onLoad="iFrameOn();">
<h2>My web application that intakes data from users</h2>
<form action="my_parse_file.php" name="myform" id="myform" method="post">
<p>Entry Title: <input name="title" id="title" type="text" size="80" maxlength="80" /></p>
<p>Entry Body:<br>
<div id="wysiwyg_cp" style="padding:8px; width:700px;">
<input type="button" onClick="iBold()" value="B">
<input type="button" onClick="iUnderline()" value="U">
<input type="button" onClick="iItalic()" value="I">
@max19931
max19931 / fuzz.html
Created August 16, 2019 21:00 — forked from LiveOverflow/fuzz.html
Fuzz innerHTML vs. DOMParser
<html>
<body>
<script>
const tags = ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "math", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "slot", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "svg", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr"]
@max19931
max19931 / js_observer.js
Last active August 13, 2019 12:39 — forked from kottenator/js_observer.js
JavaScript Simple Observer
/**
* var MyObject = {...}; // your custom object
* Observer.apply(MyObject); // you also can apply Observer to a prototype
* MyObject.on('inited', function() { console.log("I'm alive!"); });
* MyObject.trigger('inited');
*/
var Observer = {
apply: function(obj) {
obj.events = {};
obj.on = this.on;
!function() {
var doc = document,
htm = doc.documentElement,
lct = null, // last click target
nearest = function(elm, tag) {
while (elm && elm.nodeName != tag) {
elm = elm.parentNode;
}
return elm;
};
@max19931
max19931 / primer.js
Created July 24, 2019 13:14 — forked from waleedka/primer.js
A simple lib to handle AJAX, dialogs, and forms
!function() {
var doc = document,
htm = doc.documentElement,
lct = null, // last click target
nearest = function(elm, tag) {
while (elm && elm.nodeName != tag) {
elm = elm.parentNode;
}
return elm;
};