- Click-to-copy (semi-trusted): https://gist.github.com/JamesMGreene/8597596
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
var reporterInterface = { | |
"start": function(data) { | |
/* | |
data: { | |
} | |
*/ | |
}, |
https://gist.github.com/JamesMGreene/3ded0f6e7f0a658b9394
window.onerror = function(msg, url, lineno, colno, error) {
// `window.onerror` handlers now have a 5th argument: the `Error` object itself (or `null`).
// This can then be used to get stack info, error type/name, etc.
};
Working draft of the API for the new ZeroClipboard "Core" sub-module in v2.0.0. This sub-module only provides the core Flash and clipboard injection facilities but none of the DOM, "Client", resizing, repositioning, etc. logic/code.
NOTE: A checked checkbox means that line item has already been implemented in the latest ZeroClipboard master
branch.
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
/*global QUnit, window, global */ | |
(function (QUnit, global) { | |
'use strict'; | |
var document = global && global.document; | |
var pendingTestIds = []; | |
var QUnit_test = QUnit.test; | |
QUnit.test = function(testName, expected, callback, async) { |
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
var btn = document.getElementById("copy-button"); | |
btn.addEventListener("click", clickHandler, false); | |
function clickHandler(e) { | |
var clip = new ClipboardEvent("copy"); | |
clip.clipboardData.setData("text/plain", "foo"); | |
clip.clipboardData.setData("text/html", "<b>foo</b>"); | |
// CRITICAL: Must call `preventDefault();` to get this data into the system/desktop clipboard!!! | |
clip.preventDefault(); |
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
var btn = document.getElementById("copy-button"); | |
btn.addEventListener("click", clickHandler, false); | |
btn.addEventListener("copy", copyHandler, false); | |
function clickHandler(e) { | |
e.target.dispatchEvent(new ClipboardEvent("copy")); | |
} | |
function copyHandler(e) { | |
e.clipboardData.setData("text/plain", "Simulated copy. Yay!"); |
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
var page = require("webpage").create(); | |
page.onConsoleMessage = function(msg) { | |
console.log('[PAGE] Message: ' + msg); | |
}; | |
page.open("http://google.com/", function(status) { | |
if (status !== "success") { | |
console.error("Failed to load the page. Usually this means some resource failed to load."); | |
phantom.exit(1); |
Picture a [non-modular] folder structure like this:
root/
- Gruntfile.js
- node_modules/
- Platform/
- Gruntfile.js
- ...
- Products/