From 00c10c99d821ab5669cc04de245aed2d50632689 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Thu, 18 Feb 2016 14:25:47 +0800 Subject: [PATCH] remove phantom js --- script/phantomjs-save-screenshot.js | 57 ----------------------------- 1 file changed, 57 deletions(-) delete mode 100755 script/phantomjs-save-screenshot.js diff --git a/script/phantomjs-save-screenshot.js b/script/phantomjs-save-screenshot.js deleted file mode 100755 index 5ca47835..00000000 --- a/script/phantomjs-save-screenshot.js +++ /dev/null @@ -1,57 +0,0 @@ -//parse arguments passed from command line (or more likely, from rails) -var system = require('system'); -var args = system.args; -if (args.length <= 1) { - phantom.exit(); - throw new Error("no arguments supplied on command line"); -}//if - -//configurable variables - CHANGE ME -var mapID = args[1]; -var environment = args[2]; -var address = environment === 'development' ? 'http://localhost:3000' : 'http://metamaps.herokuapp.com'; -var url = address + '/maps/' + mapID; -var width = 940; -var height = 630; - -//set up page and the area we'll render as a PNG -var page = require('webpage').create(); -page.viewportSize = { - width: width, - height: height -}; - -page.open(url, function (status) { - if (status === 'success') { - //since this isn't evaluateAsync, it should also ensure the asynchronous - //js stuff is loaded too, hopefully? - - page.onCallback = function(data){ - - //pass to ruby - console.log(page.renderBase64('PNG')); - - //render to the metamaps_gen002 directory for debug - //page.render('map1.png', 'PNG'); - - phantom.exit(); - }; - - page.evaluate(function() { - - $(document).ready(function () { - //$(document).on(Metamaps.JIT.events.animationDone, function() { - setTimeout(function(){ - $('.upperLeftUI, .upperRightUI, .mapControls, .infoAndHelp, .uv-icon, .footer').hide(); - Metamaps.JIT.zoomExtents(); - window.callPhantom(); - }, 5000); - }); - - });//page.evaluate - - } else { - //failed to load - phantom.exit(); - }//if -});