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
// | |
// Example usage: phantomjs screenshot.js http://yahoo.com /tmp/yahoo.png | |
// | |
var system = require('system'); | |
var url = system.args[1]; | |
var filename = system.args[2]; | |
var page = new WebPage(); | |
page.open(url, function (status) { |
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
<input type='file' id='picker'> | |
<img style='border: 1px solid black' id='img'> | |
<script> | |
var onFilePicked = function(el, callback, opts) { | |
opts = opts || {} | |
var delayedCallback = function(url) { | |
setTimeout(function() {callback(url)}, 0); | |
} | |
el.onchange = el.onmouseout = function(event) { |