Commit 8076c5b7 by Brian Wilson

remove unneeded files (that break collectstatic)

parent 6d174ef0
div.h-pdf-container {
width: 100%;
height: 100%;
text-align: center;
background: #444 url("images/texture.png");
font: 11px verdana;
}
.h-pdf-toolbar {
background-image: url("images/texture.png"), -moz-linear-gradient(rgba(81, 81, 81, 0.99), rgba(68, 68, 68, 0.95));
border-left: 1px solid rgba(0, 0, 0, 0.5);
box-shadow: 1px 0 0 rgba(255, 255, 255, 0.08) inset, 0 1px 1px rgba(0, 0, 0, 0.15) inset, 0 -1px 0 rgba(255, 255, 255, 0.05) inset, 0 1px 0 rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.1);
height: 32px;
position: relative;
}
.h-pdf-toolbar-left {
}
.h-pdf-toolbar-right {
float: right;
}
.h-pdf-toolbar-center-outer {
position: relative;
float: right;
right: 50%;
}
.h-pdf-toolbar-center {
position: relative;
float: right;
right: -50%;
}
.h-pdf-toolbar-group {
padding: 0px;
margin: 3px;
border: 1px outset transparent;
display: inline-block;
float: left;
line-height: 8px;
}
.h-pdf-toolbar-group .h-pdf-button:last-child {
border-left: 1px inset rgba(0,0,0,0.2);
}
.h-pdf-toolbar-group:hover {
border-color: rgba(0,0,0,0.3);
border-color: rgba(0, 0, 0, 0.32) rgba(0, 0, 0, 0.38) rgba(0, 0, 0, 0.42);
border-style: solid;
border-width: 1px;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 0 1px rgba(255, 255, 255, 0.15) inset, 0 1px 0 rgba(255, 255, 255, 0.05);
}
.h-pdf-button {
width: 16px;
height: 16px;
padding: 4px;
display: inline-block;
background-repeat: no-repeat;
background-position: 4px 4px;
}
.h-pdf-button:hover {
background-color: rgba(0,0,0,0.1);
}
.h-pdf-button:active {
background-color: rgba(255,255,255,0.1);
}
.h-pdf-next {
background-image: url("images/toolbarButton-pageDown.png");
}
.h-pdf-prev {
background-image: url("images/toolbarButton-pageUp.png");
}
.h-pdf-pagetext, .h-pdf-pageinput, .h-pdf-pagecount {
position: relative;
float: left;
margin-left: 10px;
line-height: 30px;
}
.h-pdf-pagetext, .h-pdf-pagecount {
color: #d8d8d8;
}
.h-pdf-pageinput {
position: relative;
margin-top: 5px;
width: 50px;
background-color: rgba(255, 255, 255, 0.09);
background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
border-color: rgba(0, 0, 0, 0.32) rgba(0, 0, 0, 0.38) rgba(0, 0, 0, 0.42);
border-radius: 2px 2px 2px 2px;
border-style: solid;
border-width: 1px;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05) inset, 0 1px 0 rgba(255, 255, 255, 0.05);
color: #F2F2F2;
text-align: right;
padding: 3px 6px;
margin-left: 5px;
}
.h-pdf-pageinput:focus {
background-color: rgba(255, 255, 255, 0.15);
border-color: rgba(76, 183, 255, 0.8) rgba(76, 183, 255, 0.85) rgba(76, 183, 255, 0.9);
}
.h-pdf-zoom {
position: relative;
float: left;
margin: 4px 15px;
line-height: 22px;
width: 120px;
overflow: hidden;
border-color: rgba(0, 0, 0, 0.32) rgba(0, 0, 0, 0.38) rgba(0, 0, 0, 0.42);
border-style: solid;
border-width: 1px;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 0 1px rgba(255, 255, 255, 0.15) inset, 0 1px 0 rgba(255, 255, 255, 0.05);
background: url("images/toolbarButton-menuArrows.png") no-repeat scroll 95% center transparent;
}
.h-pdf-zoom:hover {
background-color: rgba(0,0,0,0.2);
}
.h-pdf-zoom-select {
-moz-appearance: none;
background: none repeat scroll 0 0 transparent;
border: medium none;
color: #F2F2F2;
font-size: 12px;
margin: 0;
min-width: 140px;
padding: 0;
}
.h-pdf-download {
float: right;
display: inline-block;
margin: 3px;
border: 1px outset transparent;
background-image: url("images/toolbarButton-download.png");
}
.h-pdf-download:hover {
border-color: rgba(0,0,0,0.3);
border-color: rgba(0, 0, 0, 0.32) rgba(0, 0, 0, 0.38) rgba(0, 0, 0, 0.42);
border-style: solid;
border-width: 1px;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 0 1px rgba(255, 255, 255, 0.15) inset, 0 1px 0 rgba(255, 255, 255, 0.05);
}
.h-pdf-canvas-container {
overflow: auto;
border-width: 0px 1px 1px;
border-style: solid;
border-color: rgba(150,150,150,0.1);
position: absolute;
right: 0px;
bottom: 0px;
left: 0px;
}
.h-pdf-canvas {
background: #fff;
box-shadow: 4px 4px 8px rgba(0,0,0,0.2);
border: 1px solid rgba(0,0,0,0.3);
margin: 15px;
}
.h-pdf-progress, .h-pdf-progress-bar, .h-pdf-progress-bar-overlay {
border-radius: 5px;
}
.h-pdf-progress {
position: absolute;
width: 200px;
height: 25px;
border: 1px inset rgba(0,0,0,0.2);
box-shadow: 1px 1px 2px rgba(0,0,0,0.4);
background-image: linear-gradient(bottom, rgba(0,0,0,0.2) 25%, rgba(0,0,0,0.1) 75%);
background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.2) 25%, rgba(0,0,0,0.1) 75%);
background-image: -moz-linear-gradient(bottom, rgba(0,0,0,0.2) 25%, rgba(0,0,0,0.1) 75%);
background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.2) 25%, rgba(0,0,0,0.1) 75%);
background-image: -ms-linear-gradient(bottom, rgba(0,0,0,0.2) 25%, rgba(0,0,0,0.1) 75%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.25, rgba(0,0,0,0.2)),
color-stop(0.75, rgba(0,0,0,0.1))
);
}
.h-pdf-progress-bar {
height: 100%;
width: 0%;
background-image: linear-gradient(bottom, rgb(4,115,143) 14%, rgb(0,146,179) 57%);
background-image: -o-linear-gradient(bottom, rgb(4,115,143) 14%, rgb(0,146,179) 57%);
background-image: -moz-linear-gradient(bottom, rgb(4,115,143) 14%, rgb(0,146,179) 57%);
background-image: -webkit-linear-gradient(bottom, rgb(4,115,143) 14%, rgb(0,146,179) 57%);
background-image: -ms-linear-gradient(bottom, rgb(4,115,143) 14%, rgb(0,146,179) 57%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.14, rgb(4,115,143)),
color-stop(0.57, rgb(0,146,179))
);
}
.h-pdf-progress-bar-overlay {
width: 100%;
height: 100%;
background-image: url("images/texture2.png");
background-position: right;
}
/**
* jQuery PDF-DOC Plugin
*
* LICENSE
*
* This source file is subject to the Apache Licence, Version 2.0 that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://dev.funkynerd.com/projects/hazaar/wiki/licence
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@funkynerd.com so we can send you a copy immediately.
*
* @copyright Copyright (c) 2012 Jamie Carl (http://www.funkynerd.com)
* @license http://dev.funkynerd.com/projects/hazaar/wiki/licence Apache Licence, Version 2.0
* @version 0.7
*/
//PDFJS.workerSrc = 'hazaar/js/pdf.js';
PDFJS.disableWorker = true;
(function ( $ ){
$.fn.PDFDoc = function( options ) {
renderPage = function (pdf, the_page, canvas, scale){
// Using promise to fetch the page
pdf.getPage(the_page).then(function(page) {
var viewport = page.getViewport(scale);
var context = canvas.getContext('2d');
canvas.height = viewport.height;
canvas.width = viewport.width;
page.render( { canvasContext: context, viewport: viewport } );
$('#h-page-input').val(the_page);
});
}
var settings = $.extend( {
'page' : 1,
'scale' : 1
}, options);
if(!settings.source){
$.error('No PDF document source was given');
return this;
}
var mydoc = this;
var page_count = 0;
mydoc.addClass('h-pdf-container');
var canvas_container = $('<div>', { 'class' : 'h-pdf-canvas-container' } );
var canvas = $('<canvas>', { 'class' : 'h-pdf-canvas'});
canvas.dblclick(function(event){
var scale = mydoc.data('scale');
scale += 0.5;
mydoc.data('scale', scale);
renderPage(mydoc.data('pdf'), mydoc.data('current_page'), $(this).get()[0], scale);
$('#page-zoom').val(scale);
});
/*
*Create the toolbar layouts
*/
var toolbar = $('<div>', { 'class' : 'h-pdf-toolbar'});
var toolbar_left = $('<div>', { 'class' : 'h-pdf-toolbar-left' } );
var toolbar_right = $('<div>', { 'class' : 'h-pdf-toolbar-right' } );
var toolbar_center = $('<div>').addClass('h-pdf-toolbar-center');
toolbar.append(toolbar_left).append(toolbar_right).append(toolbar_center);
mydoc.append(toolbar);
/*
* Create the nav buttons
*/
var but_next = $('<div>', { 'class' : 'h-pdf-button h-pdf-next', 'title' : 'Next Page' } ).click(function(){
var current_page = mydoc.data('current_page');
if(current_page < page_count){
current_page++;
renderPage(mydoc.data('pdf'), current_page, canvas.get()[0], mydoc.data('scale'));
}
mydoc.data('current_page', current_page);
});
var but_prev = $('<div>', { 'class' : 'h-pdf-button h-pdf-prev', 'title' : 'Previous Page' } ).click(function(){
var current_page = mydoc.data('current_page');
if(current_page > 1){
current_page--;
renderPage(mydoc.data('pdf'), current_page, canvas.get()[0], mydoc.data('scale'));
}
mydoc.data('current_page', current_page);
});
/*
* Create the page input
*/
var page_text = $('<span>', { 'class' : 'h-pdf-pagetext', 'html' : 'Page:' } );
var page_input = $('<input>', { 'type' : 'text', 'class' : 'h-pdf-pageinput', 'value' : settings.page, 'id' : 'h-page-input' } );
page_input.keypress(function(event){
if(event.which == 13){
current_page = $(this).val();
renderPage(mydoc.data('pdf'), current_page, canvas.get()[0], mydoc.data('scale'));
mydoc.data('current_page', current_page);
}else if((event.which < 48 || event.which > 57) && ( event.which != 8 && event.which != 0)){
return false;
}
});
var of_text = $('<span>', { 'class' : 'h-pdf-pagetext', 'html' : 'of ' });
var pages_text = $('<span>', { 'class' : 'h-pdf-pagecount', 'html' : page_count, 'id' : 'pagecount' });
/*
* Create the zoom droplist
*/
var zoomModes = { 3 : '300%', 2 : '200%', 1.5 : '150%', 1 : 'Actual Size', 0.5 : 'Half Size', 0.25 : '25%', 0.1 : '10%' };
var zoom = $('<span>', { 'class' : 'h-pdf-zoom' } );
var zoom_select = $('<select>', { 'class' : 'h-pdf-zoom-select', 'id' : 'page-zoom' } );
zoom.append(zoom_select);
$.each( zoomModes, function(key, value) {
var op = zoom_select.append($("<option></option>").attr("value",key).text(value));
});
zoom_select.change(function(){
var scale = parseFloat($(this).val());
renderPage(mydoc.data('pdf'), mydoc.data('current_page'), canvas.get()[0], scale);
mydoc.data('scale', scale);
}).val(settings.scale);
/*
* Add the nav buttons, page input and zoom droplist to the center toolbar
*/
toolbar_center.append($('<div>', { 'class' : 'h-pdf-toolbar-group' } ).append(but_prev).append(but_next))
.append(page_text)
.append(page_input)
.append(of_text)
.append(pages_text)
.append(zoom);
toolbar.append($('<div>', { 'class' : 'h-pdf-toolbar-center-outer' } ).append(toolbar_center));
/*
* Create the direct download button
*/
var but_dl = $('<div>', { 'class' : 'h-pdf-button h-pdf-download' } );
but_dl.click(function(){
var delim = '?';
if( url =~ /\?/){
delim = '&';
}
var url = settings.source + delim + "action=download";
window.open(url, '_parent');
});
toolbar_right.append(but_dl);
var resize_canvas = function(){
canvas_container.css('height', mydoc.height() - toolbar.height());
}
resize_canvas();
mydoc.append(canvas_container.append(progress));
var progress = $('<div>', { 'class' : 'h-pdf-progress' } );
progress.css( { top : (canvas_container.height() / 2) - (progress.height() / 2), left : (canvas_container.width() / 2) - (progress.width() / 2) } );
progress.append($('<div>', { 'class' : 'h-pdf-progress-bar' } ).append($('<div>', { 'class' : 'h-pdf-progress-bar-overlay' } )));
canvas_container.append(progress);
PDFJS.getDocument(settings.source).then(
function getDocumentCallback(pdf) {
canvas_container.html(canvas);
page_count = pdf.numPages;
$('#pagecount').html(page_count);
mydoc.data('pdf', pdf);
renderPage(pdf, settings.page, canvas.get()[0], settings.scale);
},
function getDocumentError(message, exception) {
},
function getDocumentProgress(progressData) {
var pct = 100 * (progressData.loaded / progressData.total);
progress.children('div').css('width', pct + '%');
}
);
this.data('current_page', settings.page);
this.data('scale', settings.scale);
$(window).resize(function(){
resize_canvas();
});
return this;
};
})( jQuery );
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment