The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.
Send messages to iframe using iframeEl.contentWindow.postMessage
Recieve messages using window.addEventListener('message')
// @desc Creates a list of domains with custom TLDs using a pattern string with fixed length with option for keywords | |
// @param {String} pattern | |
// @param {Array|String} tlds | |
// @returns {Array} domainList | |
// | |
// | |
// Pattern string is defined by: | |
// - keywords lowercase | |
// - any letter uppercase A | |
// - consonants uppercase C |
A list of sketch scripts |
const tokenArray = [ | |
{ name: 'color-background-default', value: '#f5f7fa'}, | |
{ name: 'color-background-white', value: '#fff'}, | |
{ name: 'color-background-dark', value: '#202d40'}, | |
{ name: 'color-background-tooltip', value: '#202d40'}, | |
{ name: 'color-background-message-warning', value: '#fffbe5'}, | |
{ name: 'color-background-message-success', value: '#f2ffe0'}, | |
{ name: 'color-background-message-error', value: '#fff0f0'}, | |
{ name: 'color-background-message-info', value: '#e6f7ff'}, | |
{ name: 'color-background-list-row-hover', value: '#f5f7fa'}, |
const sketch = require("sketch") | |
const document = sketch.getSelectedDocument() | |
const selection = document.selectedLayers.layers | |
const Group = sketch.Group | |
const Style = sketch.Style | |
const Rectangle = sketch.Rectangle | |
const Artboard = sketch.Artboard | |
const ShapePath = sketch.ShapePath | |
const Text = sketch.Text | |
const SymbolInstance = sketch.SymbolInstance |
<html> | |
<head> | |
<body onload="onLoad()"> | |
<div id="container"> | |
<div id="show-background">Show background as magenta<input id="show-background-toggle" type="checkbox" checked></div> | |
<canvas id="canvas" width=640px height=480px></canvas> | |
</div> | |
</body> | |
</head> | |
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]"> </script> |
let dialog = NSAlert.alloc().init() | |
let view = NSView.alloc().initWithFrame(NSMakeRect(0,0,100,100)) | |
let button = MSColorWell.alloc().initWithFrame(NSMakeRect(0,0,50,50)) | |
button.initialColor = NSColor.redColor() | |
button.target = button | |
button.canDisplayPopover = true | |
button.setAction("presentColorPicker:") | |
view.addSubview(button) | |
dialog.accessoryView = view |
<!DOCTYPE html> | |
<html lang="zh-CN" class="fullscreen"> | |
<head> | |
<title>flex未知高度垂直居中写法</title> | |
<style> | |
html,body{ | |
width: 100%; | |
height: 100%; | |
overflow: hidden; |
Express 2 was used in the course and the current version is 4.x. | |
you can't just use 'urlencoded' anymore, you have to: | |
npm install body-parser | |
and | |
var bodyParser = require('body-parser'); | |
app.use(bodyParser.urlencoded({ extended: true })); |