initial import

This commit is contained in:
2020-12-23 10:11:11 +01:00
commit be83b43a59
5600 changed files with 577973 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
@import url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css');
@import url('../../../dist/css/bootstrap-datepicker3.min.css');
body {
/* Padding around all elements to allow space for screenshots */
padding: 10px;
/* Transparent background for PNG screenshots */
background: none;
}

View File

@@ -0,0 +1,2 @@
document.write("<script src='https://code.jquery.com/jquery-3.1.1.min.js'></script>");
document.write("<script src='../../js/bootstrap-datepicker.js'></script>");

View File

@@ -0,0 +1,21 @@
/*
Usage: $ phantomjs --remote-debugger-port=9001 --remote-debugger-autorun=yes debug.js page.html
Open Chrome tab to http://localhost:9001/; open second link (ie, path to page.html)
*/
var system = require('system' ), fs = require('fs'), webpage = require('webpage');
(function(phantom){
var page=webpage.create();
function debugPage(){
console.log("Refresh a second debugger-port page and open a second webkit inspector for the target page.");
console.log("Letting this page continue will then trigger a break in the target page.");
debugger; // pause here in first web browser tab for steps 5 & 6
page.open(system.args[1]);
page.evaluateAsync(function() {
debugger; // step 7 will wait here in the second web browser tab
});
}
debugPage();
}(phantom));

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,69 @@
/* jshint phantom:true, devel:true */
/* Usage: phantomjs screenshot.js in.html out.png */
var sys = require('system'),
page = new WebPage();
page.viewportSize = {
width: 800,
height: 600
};
page.open(sys.args[1], function(status){
if (status !== 'success'){
console.log('Bad status: %s', status);
phantom.exit(1);
}
window.setTimeout(function(){
var box = page.evaluate(function(){
var lefts, rights, tops, bottoms,
padding = 10, // px
selection, show;
// Call setup method
if (window.setup)
window.setup();
// Show all pickers, or only those marked for showing
show = $('body').data('show');
show = show ? $(show) : $('*');
show
.filter(function(){
return 'datepicker' in $(this).data();
})
.datepicker('show');
// Get bounds of selected elements
selection = $($('body').data('capture'));
tops = selection.map(function(){
return $(this).offset().top;
}).toArray();
lefts = selection.map(function(){
return $(this).offset().left;
}).toArray();
bottoms = selection.map(function(){
return $(this).offset().top + $(this).outerHeight();
}).toArray();
rights = selection.map(function(){
return $(this).offset().left + $(this).outerWidth();
}).toArray();
// Convert bounds to single bounding box
var b = {
top: Math.min.apply(Math, tops),
left: Math.min.apply(Math, lefts)
};
b.width = Math.max.apply(Math, rights) - b.left;
b.height = Math.max.apply(Math, bottoms) - b.top;
// Return bounding box
return {
top: Math.max(b.top - padding, 0),
left: Math.max(b.left - padding, 0),
width: b.width + 2 * padding,
height: b.height + 2 * padding
};
});
page.clipRect = box;
page.render(sys.args[2]);
phantom.exit();
}, 1);
});