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')
| /* | |
| * Taken from http://stackoverflow.com/questions/5867534/how-to-save-canvas-data-to-file/5971674#5971674 | |
| */ | |
| var fs = require('fs'); | |
| // string generated by canvas.toDataURL() | |
| var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0" | |
| + "NAAAAKElEQVQ4jWNgYGD4Twzu6FhFFGYYNXDUwGFpIAk2E4dHDRw1cDgaCAASFOffhEIO" | |
| + "3gAAAABJRU5ErkJggg=="; | |
| // strip off the data: url prefix to get just the base64-encoded bytes |
Eric Steven Raymond, Thyrsus Enterprises, < [email protected] >
Rick Moen, < [email protected] >
翻译:柯非, < [email protected] >
这篇译文基于2014.05.21更新的原文修订版3.10。
特别感谢王刚,此前本文的翻译是由他进行的。
This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:
*nix based command prompt (but not the default Windows Command Prompt!)cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows).ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.ssh-keygen -t rsa -C "[email protected]". Th| server { | |
| listen 80 default deferred; | |
| server_name myapp.com; | |
| root /var/www/project-folder/; | |
| # Nginx and Angularjs with html mode 5 - https://gist.github.com/cjus/b46a243ba610661a7efb | |
| index index.html; |
| server { | |
| server_name yoursite.com; | |
| root /usr/share/html; | |
| index index.html; | |
| location / { | |
| try_files $uri $uri/ /index.html; | |
| } | |
| } |
| node_modules | |
| *.swp |
| /*! | |
| * isVis - v0.5.5 Aug 2011 - Page Visibility API Polyfill | |
| * Copyright (c) 2011 Addy Osmani | |
| * Dual licensed under the MIT and GPL licenses. | |
| */ | |
| (function () { | |
| window.visibly = { | |
| b: null, | |
| q: document, |
| /** | |
| * Simply compares two string version values. | |
| * | |
| * Example: | |
| * versionCompare('1.1', '1.2') => -1 | |
| * versionCompare('1.1', '1.1') => 0 | |
| * versionCompare('1.2', '1.1') => 1 | |
| * versionCompare('2.23.3', '2.22.3') => 1 | |
| * | |
| * Returns: |