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')
/* | |
The MIT License (MIT) | |
Copyright (c) 2014 Ismael Celis | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
'use strict'; | |
angular.module('mq-appcache', []) | |
.directive('manifest', function() { | |
return { | |
compile: function() { | |
if (window.applicationCache) { | |
applicationCache.addEventListener('updateready', function() { | |
console.log('New version downloaded, reload to see the changes.'); | |
}); |
CREATE EXTENSION tablefunc; | |
CREATE TABLE sales(year int, month int, qty int); | |
INSERT INTO sales VALUES(2007, 1, 1000); | |
INSERT INTO sales VALUES(2007, 2, 1500); | |
INSERT INTO sales VALUES(2007, 7, 500); | |
INSERT INTO sales VALUES(2007, 11, 1500); | |
INSERT INTO sales VALUES(2007, 12, 2000); | |
INSERT INTO sales VALUES(2008, 1, 1000); | |
INSERT INTO sales VALUES(2009, 5, 2500); |
String.prototype.strspn = function (chars, start, length) { | |
var end; | |
if (start == undefined) | |
start = 0; | |
else if (start < 0) | |
start += this.length; | |
if (length == undefined) | |
length = this.length; |
nginx/ | |
!nginx/.gitkeep | |
!nginx/logs/.gitkeep | |
src/ | |
tmp/ |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
// Mostly came from https://developers.google.com/google-apps/calendar/quickstart/nodejs | |
var fs = require('fs'); | |
var readline = require('readline'); | |
var google = require('googleapis'); | |
var googleAuth = require('google-auth-library'); | |
// If modifying these scopes, delete your previously saved credentials | |
// at ~/.credentials/calendar-nodejs-quickstart.json | |
var SCOPES = ['https://www.googleapis.com/auth/calendar']; |
const templates = Object.create(null, { | |
load: { | |
value: async function(fileName) { | |
const url = new URL(fileName, | |
document.currentScript && document.currentScript.src || location.href) | |
if (url in this) return this[url] | |
// fetch and parse template as string | |
let template = await fetch(url) | |
template = await template.text() | |
template = new DOMParser().parseFromString(template, 'text/html') |
This gist is now deprecated in favor of our official documentation: https://documentation.portainer.io/api/api-examples/ which contains up to date examples!
Please refer to the link above to get access to our updated API documentation and examples.