From 30b3b377208a4478780049ae25e4c5336ec2c124 Mon Sep 17 00:00:00 2001 From: Gemma Gentles Date: Tue, 18 Jul 2017 18:14:47 +0100 Subject: [PATCH 1/3] The screenshots taken get cut off at the fold of what ever screen you run Wraith on. We need the screenshot to show the full page. Remove the set height in the clipRect to default as auto height to solve this issue. --- lib/wraith/javascript/phantom.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/wraith/javascript/phantom.js b/lib/wraith/javascript/phantom.js index 78f1a89b..6dbd6a86 100644 --- a/lib/wraith/javascript/phantom.js +++ b/lib/wraith/javascript/phantom.js @@ -132,12 +132,6 @@ function resizeAndCaptureImage() { function takeScreenshot() { console.log('Snapping ' + url + ' at: ' + currentDimensions.viewportWidth + 'x' + currentDimensions.viewportHeight); - page.clipRect = { - top: 0, - left: 0, - height: currentDimensions.viewportHeight, - width: currentDimensions.viewportWidth - }; page.render(image_name); } From 8777585fa609d48a4eeddc8f28cce52fa8a92329 Mon Sep 17 00:00:00 2001 From: Gemma Gentles Date: Tue, 18 Jul 2017 18:22:38 +0100 Subject: [PATCH 2/3] There is no option to add a customized template that styles the gallery.html page that shows all the screenshot results. By adding to the url path string we can pull the current local directory on the persons machine, and pull a custom erb file in a new gallery_template folder inside this repo itself, in templates. --- lib/wraith/gallery.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wraith/gallery.rb b/lib/wraith/gallery.rb index b764dc9a..7771d95a 100755 --- a/lib/wraith/gallery.rb +++ b/lib/wraith/gallery.rb @@ -141,7 +141,7 @@ def generate_gallery(with_path = "") dest = "#{@location}/gallery.html" directories = parse_directories(@location) - template = File.expand_path("gallery_template/#{wraith.gallery_template}.erb", File.dirname(__FILE__)) + template = File.expand_path(Dir.pwd + "/gallery_template/#{wraith.gallery_template}.erb", File.dirname(__FILE__)) generate_html(@location, directories, template, dest, with_path) report_gallery_status dest From 38555bbe7d44c02c692b8b5bd752fd9464a9ca0f Mon Sep 17 00:00:00 2001 From: Gemma Gentles Date: Thu, 20 Jul 2017 15:50:38 +0100 Subject: [PATCH 3/3] Prep for Gemfile. --- Gemfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 6c546840..73f50251 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,7 @@ -source "https://rubygems.org" +source 'https://rubygems.org' # Specify your gem's dependencies in wraith.gemspec + +gem 'wraith', :git => 'https://github.com/gemmageee/wraith.git', :branch => 'master' + gemspec