Current working tree.

Has some issues to be worked out.
This commit is contained in:
Curle 2020-09-14 21:22:46 +01:00
parent 15392a628f
commit dbabeeefb9
Signed by: TheCurle
GPG Key ID: 2F2E62F0DA69A5AE
21 changed files with 35123 additions and 0 deletions

17
backend/config.php Normal file
View File

@ -0,0 +1,17 @@
<?php
/**
* This file currently only exists to set the path for files.
*
* This will be used for more!
* Namely, a database connection.
*/
$config = array(
"images" => "./photos/",
"thumbs" => "./backend/thumbs/"
);
ini_set("error_reporting", "true");
error_reporting(E_ALL | E_STRCT);

239
backend/functions.php Normal file
View File

@ -0,0 +1,239 @@
<?php
/**
* Debug output to the browser console
*/
function console_log( $data ) {
echo "<script>";
echo "console.log(". json_encode( $data ) . ")";
echo "</script";
}
/**
* List the subdirectories of a folder.
* Ignore ones marked hidden.
*/
function listFolders( $root, $hidden=false) {
$list = array();
if( !is_dir( $root ) ) {
throw new Exception("'".$root."' is not a folder!");
}
$root_content = scandir( $root );
/**
* Catch no permission, or empty folder
*/
if( empty( $root_content) ) {
return $list;
}
foreach ( $root_content as $subdir ) {
if ( ($subdir[0] != "." || $hidden ) && is_dir( $path = $root."/".$subdir) ) {
$list[] = $path;
}
}
return $list;
}
/**
* List all files in the folder.
* Ignores hidden files.
*/
function listFiles( $root, $cascade=false, $first=false ) {
$list = array();
if( !is_dir( $root ) ) {
throw new Exception("'".$root."' is not a folder.");
}
$files = scandir( $root );
/**
* Catch no permission, or empty folder
*/
if ( empty( $files ) ) {
return $list;
}
foreach ( $files as $file ) {
if( $file[0] != "." ) {
if ( is_file( $path = $root."/".$file ) ) {
if ( $first ) {
return $path;
}
$list[] = $path;
} else {
if($cascade) {
$list = array_merge( $list, listFiles( $root . "/" . $file, true));
}
}
}
}
if($first) {
return $list[0];
}
return $list;
}
/**
* Discount strip_slashes - from a file name
*/
function tidyName( $name ) {
if ( strpos( $name, "/" ) > -1 ) {
return substr( $name, strrpos( $name, "/" ) + 1);
} else {
return $name;
}
}
/**
* Check directory structure for integrity
*/
function isPathValid( $file, $path ) {
$realFile = realpath( $file );
$realDir = realpath( $path );
/**
* If the two paths match, then the path is valid
*/
if ( $realFile == $realDir ) {
return true;
}
/**
* If the file path starts with the dir path,
* then the file path is valid
*/
if ( substr( $realFile, 0, strlen( $realDir ) ) == $realDir ) {
return true;
}
/**
* Otherwise, the file is not in the path, and it is invalid.
*/
return false;
}
/**
* Set up headers and send a http reply with the given file.
*/
function sendFile( $image ) {
// Expires in 2 weeks
$expires = 60*60*24*14;
$lastModified = filemtime( $image );
//$etag = md5_file( $image );
header("Last-Modified: $lastModified GMT");
header("Pragma: public");
header("Cache-Control: max-age=$expires");
//header("Etag: $etag");
header("Expires: " . gmdate('D, d M Y H:i:s', time() + $expires) . " GMT");
header("Content-type: image/jpeg");
readfile( $image );
}
/**
* Check that a file is in a given folder.
*/
function isInFolder( $file, $folder ) {
return substr( $folder, 0, strlen( $file ) ) == $file;
}
/**
* Convert an absolute path (for filesystem) to a relative path (for web server)
*/
function absoluteToRelative( $file, $folder ) {
$realFile = realpath( $file );
$realDir = realpath( $folder );
if ($realFile == $realDir ) return "";
if ( !isInFolder( $realDir, $realFile ) ) {
throw new Exception("File is not in the photos folder.");
}
return substr( $realFile, strlen( $realDir ) + 1);
}
/**
* Convert a relative path (from the file server) to an absolute path (for the filesystem)
*/
function relativeToAbsolute( $file, $folder ) {
return $folder . "/" . $file;
}
/**
* Get all of the steps needed to get to where we are, from the home page
*/
function breadcrumbs( $path ) {
$list = array();
$slash = strpos( $path, "/");
while($slash > 0) {
$list[] = substr( $path, 0, $slash );
$path = substr( $path, $slash + 1 );
$slash = strpos( $path, "/" );
}
if( $path != "" ) {
$list[] = $path;
}
return $list;
}
/**
* Create a smaller copy of the image to serve as a thumbnail.
*/
function createThumbnail( $source, $thumbnailPath, $thumbnailFolder ) {
require_once("resources/libs/php/ThumbLib.inc.php");
if ( !file_exists( $thumbnailPath ) || filectime( $source ) > filectime( $thumbnailPath ) ) {
if ( !file_exists( dirname( $thumbnailPath ) ) ) {
@mkdir( dirname( $thumbnailPath ) );
}
$thumbnail = PhpThumbFactory::create( $source );
$thumbnail->resize( 200, 200 );
$thumbnail->save( $thumbnailPath );
$newFile = fopen( $thumbnailFolder . "/newImages.txt", "a+" );
fwrite( $newFile, realpath( $source ) . "\n");
$file = file( $thumbnailFolder . "/newImages.txt" );
$file = array_slice( $file, 0, 20 );
file_put_contents( $thumbnailFolder . "/newImages.txt", implode( "", $file ) );
}
}

View File

@ -0,0 +1 @@
C:\sites\obsidian\photos\testings\bolbmas.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

154
index.php Normal file
View File

@ -0,0 +1,154 @@
<?php
/*
* Load the config.
* This provides the directories for images and
* thumbnails, as well as settings, galleries
* and albums.
*/
require_once("backend/config.php");
/*
*
* Load in all the functions we'll be using..
*/
require_once("backend/functions.php");
$imagesFolder = $config["images"];
/*
* If something outside our control has added
* new images to the database, it should have also
* added an entry to the appropriate new[x].txt file.
*
* If it exists, we can read in the new values from there.
* If it doesn't, there's nothing interesting to do, and
* we just carry on init like normal.
*
*/
if( file_exists($config["thumbs"]."/newImages.txt")) {
$newImages = file($config["thumbs"]."/newImages.txt");
} else {
$newImages = array();
}
/*
* Images are retrieved from the database using GET
* (unlike 90% of my projects where everything is POST)
*
* Given that, we need to check if there are any requests
* in the headers and handle the appropriately.
*
* This effectively short-circuits the logic to pass single
* images.
*
* TODO: this could be more efficient!
*
*/
if ( isset( $_GET["image"] ) ) {
$image = relativeToAbsolute( stripslashes( $_GET["image"] ), $imagesFolder );
if ( isPathValid( $image, $imagesFolder ) ) {
return sendFile($image);
} else {
$error = "Image not found";
}
}
/*
* There is similar logic for the thumbnails.
* Theoretically this should come before full images,
* but that breaks things in testing.
*
* TODO: optimise!
*/
if ( isset( $_GET["thumb"] ) ) {
/*
* There needs to be a fallback for when an image doesn't have a generated thumbnail.
* This will prepare both the image and the thumbnail, in preparation
* for needing to send the full image, in the case that there is no thumbnail, and
* the attempt to generate the thumbnail fails.
*
* We can only spend so much time processing a tiny image, after all.
*/
$image = relativeToAbsolute( stripslashes( $_GET["thumb"] ), $imagesFolder );
$thumb = relativeToAbsolute( stripslashes( $_GET["thumb"] ), $config["thumbs"]);
if ( isPathValid( $image, $imagesFolder ) ) {
if ( !file_exists( $thumb ) ) {
createThumbnail( $image, $thumb, $config["thumbs"] );
}
// Generation can fail! We need to double check else risk a 400
if ( file_exists( $thumb ) ) {
return sendFile($thumb);
} else {
return sendFile($image);
}
} else {
$error = "Image not found!";
}
}
/**
*
* We need to be able to handle custom paths as well.
* TODO: Implement this!
*/
if ( isset( $_GET["category"] ) ) {
console_log("Loading category " . $_GET["category"] );
$tempDir = relativeToAbsolute( stripslashes( $_GET["category"] ), $imagesFolder );
console_log("Directory for category is " . $tempDir);
if ( isPathValid( $tempDir, $imagesFolder ) ) {
console_log("Directory is valid.");
$dir = $tempDir;
} else {
console_log("Directory is invalid");
$error = "Invalid category";
}
}
/**
*
* Now that we've handled all the shortcircuit logic to handle
* sending images, we can start showing a UI.
*
* First, we handle <head>:
*/
require_once("templates/header.php");
/**
* Then we show the menu at the top.
* This will contain breadcrumbs to show you what's going on.
*/
require_once("templates/menu.php");
/**
* Then we can start showing content.
*
* As it stands, this is where most of the work is going.
* Who would've thought?
*/
require_once("templates/content.php");
require_once("templates/footer.php");
?>

1312
resources/css/jquery-ui.css vendored Normal file

File diff suppressed because it is too large Load Diff

886
resources/css/jquery-ui.structure.css vendored Normal file
View File

@ -0,0 +1,886 @@
/*!
* jQuery UI CSS Framework 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/category/theming/
*/
/* Layout helpers
----------------------------------*/
.ui-helper-hidden {
display: none;
}
.ui-helper-hidden-accessible {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
.ui-helper-reset {
margin: 0;
padding: 0;
border: 0;
outline: 0;
line-height: 1.3;
text-decoration: none;
font-size: 100%;
list-style: none;
}
.ui-helper-clearfix:before,
.ui-helper-clearfix:after {
content: "";
display: table;
border-collapse: collapse;
}
.ui-helper-clearfix:after {
clear: both;
}
.ui-helper-zfix {
width: 100%;
height: 100%;
top: 0;
left: 0;
position: absolute;
opacity: 0;
filter:Alpha(Opacity=0); /* support: IE8 */
}
.ui-front {
z-index: 100;
}
/* Interaction Cues
----------------------------------*/
.ui-state-disabled {
cursor: default !important;
pointer-events: none;
}
/* Icons
----------------------------------*/
.ui-icon {
display: inline-block;
vertical-align: middle;
margin-top: -.25em;
position: relative;
text-indent: -99999px;
overflow: hidden;
background-repeat: no-repeat;
}
.ui-widget-icon-block {
left: 50%;
margin-left: -8px;
display: block;
}
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.ui-accordion .ui-accordion-header {
display: block;
cursor: pointer;
position: relative;
margin: 2px 0 0 0;
padding: .5em .5em .5em .7em;
font-size: 100%;
}
.ui-accordion .ui-accordion-content {
padding: 1em 2.2em;
border-top: 0;
overflow: auto;
}
.ui-autocomplete {
position: absolute;
top: 0;
left: 0;
cursor: default;
}
.ui-menu {
list-style: none;
padding: 0;
margin: 0;
display: block;
outline: 0;
}
.ui-menu .ui-menu {
position: absolute;
}
.ui-menu .ui-menu-item {
margin: 0;
cursor: pointer;
/* support: IE10, see #8844 */
list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
}
.ui-menu .ui-menu-item-wrapper {
position: relative;
padding: 3px 1em 3px .4em;
}
.ui-menu .ui-menu-divider {
margin: 5px 0;
height: 0;
font-size: 0;
line-height: 0;
border-width: 1px 0 0 0;
}
.ui-menu .ui-state-focus,
.ui-menu .ui-state-active {
margin: -1px;
}
/* icon support */
.ui-menu-icons {
position: relative;
}
.ui-menu-icons .ui-menu-item-wrapper {
padding-left: 2em;
}
/* left-aligned */
.ui-menu .ui-icon {
position: absolute;
top: 0;
bottom: 0;
left: .2em;
margin: auto 0;
}
/* right-aligned */
.ui-menu .ui-menu-icon {
left: auto;
right: 0;
}
.ui-button {
padding: .4em 1em;
display: inline-block;
position: relative;
line-height: normal;
margin-right: .1em;
cursor: pointer;
vertical-align: middle;
text-align: center;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
/* Support: IE <= 11 */
overflow: visible;
}
.ui-button,
.ui-button:link,
.ui-button:visited,
.ui-button:hover,
.ui-button:active {
text-decoration: none;
}
/* to make room for the icon, a width needs to be set here */
.ui-button-icon-only {
width: 2em;
box-sizing: border-box;
text-indent: -9999px;
white-space: nowrap;
}
/* no icon support for input elements */
input.ui-button.ui-button-icon-only {
text-indent: 0;
}
/* button icon element(s) */
.ui-button-icon-only .ui-icon {
position: absolute;
top: 50%;
left: 50%;
margin-top: -8px;
margin-left: -8px;
}
.ui-button.ui-icon-notext .ui-icon {
padding: 0;
width: 2.1em;
height: 2.1em;
text-indent: -9999px;
white-space: nowrap;
}
input.ui-button.ui-icon-notext .ui-icon {
width: auto;
height: auto;
text-indent: 0;
white-space: normal;
padding: .4em 1em;
}
/* workarounds */
/* Support: Firefox 5 - 40 */
input.ui-button::-moz-focus-inner,
button.ui-button::-moz-focus-inner {
border: 0;
padding: 0;
}
.ui-controlgroup {
vertical-align: middle;
display: inline-block;
}
.ui-controlgroup > .ui-controlgroup-item {
float: left;
margin-left: 0;
margin-right: 0;
}
.ui-controlgroup > .ui-controlgroup-item:focus,
.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus {
z-index: 9999;
}
.ui-controlgroup-vertical > .ui-controlgroup-item {
display: block;
float: none;
width: 100%;
margin-top: 0;
margin-bottom: 0;
text-align: left;
}
.ui-controlgroup-vertical .ui-controlgroup-item {
box-sizing: border-box;
}
.ui-controlgroup .ui-controlgroup-label {
padding: .4em 1em;
}
.ui-controlgroup .ui-controlgroup-label span {
font-size: 80%;
}
.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item {
border-left: none;
}
.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item {
border-top: none;
}
.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content {
border-right: none;
}
.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content {
border-bottom: none;
}
/* Spinner specific style fixes */
.ui-controlgroup-vertical .ui-spinner-input {
/* Support: IE8 only, Android < 4.4 only */
width: 75%;
width: calc( 100% - 2.4em );
}
.ui-controlgroup-vertical .ui-spinner .ui-spinner-up {
border-top-style: solid;
}
.ui-checkboxradio-label .ui-icon-background {
box-shadow: inset 1px 1px 1px #ccc;
border-radius: .12em;
border: none;
}
.ui-checkboxradio-radio-label .ui-icon-background {
width: 16px;
height: 16px;
border-radius: 1em;
overflow: visible;
border: none;
}
.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,
.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon {
background-image: none;
width: 8px;
height: 8px;
border-width: 4px;
border-style: solid;
}
.ui-checkboxradio-disabled {
pointer-events: none;
}
.ui-datepicker {
width: 17em;
padding: .2em .2em 0;
display: none;
}
.ui-datepicker .ui-datepicker-header {
position: relative;
padding: .2em 0;
}
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
position: absolute;
top: 2px;
width: 1.8em;
height: 1.8em;
}
.ui-datepicker .ui-datepicker-prev-hover,
.ui-datepicker .ui-datepicker-next-hover {
top: 1px;
}
.ui-datepicker .ui-datepicker-prev {
left: 2px;
}
.ui-datepicker .ui-datepicker-next {
right: 2px;
}
.ui-datepicker .ui-datepicker-prev-hover {
left: 1px;
}
.ui-datepicker .ui-datepicker-next-hover {
right: 1px;
}
.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
display: block;
position: absolute;
left: 50%;
margin-left: -8px;
top: 50%;
margin-top: -8px;
}
.ui-datepicker .ui-datepicker-title {
margin: 0 2.3em;
line-height: 1.8em;
text-align: center;
}
.ui-datepicker .ui-datepicker-title select {
font-size: 1em;
margin: 1px 0;
}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
width: 45%;
}
.ui-datepicker table {
width: 100%;
font-size: .9em;
border-collapse: collapse;
margin: 0 0 .4em;
}
.ui-datepicker th {
padding: .7em .3em;
text-align: center;
font-weight: bold;
border: 0;
}
.ui-datepicker td {
border: 0;
padding: 1px;
}
.ui-datepicker td span,
.ui-datepicker td a {
display: block;
padding: .2em;
text-align: right;
text-decoration: none;
}
.ui-datepicker .ui-datepicker-buttonpane {
background-image: none;
margin: .7em 0 0 0;
padding: 0 .2em;
border-left: 0;
border-right: 0;
border-bottom: 0;
}
.ui-datepicker .ui-datepicker-buttonpane button {
float: right;
margin: .5em .2em .4em;
cursor: pointer;
padding: .2em .6em .3em .6em;
width: auto;
overflow: visible;
}
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
float: left;
}
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi {
width: auto;
}
.ui-datepicker-multi .ui-datepicker-group {
float: left;
}
.ui-datepicker-multi .ui-datepicker-group table {
width: 95%;
margin: 0 auto .4em;
}
.ui-datepicker-multi-2 .ui-datepicker-group {
width: 50%;
}
.ui-datepicker-multi-3 .ui-datepicker-group {
width: 33.3%;
}
.ui-datepicker-multi-4 .ui-datepicker-group {
width: 25%;
}
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
border-left-width: 0;
}
.ui-datepicker-multi .ui-datepicker-buttonpane {
clear: left;
}
.ui-datepicker-row-break {
clear: both;
width: 100%;
font-size: 0;
}
/* RTL support */
.ui-datepicker-rtl {
direction: rtl;
}
.ui-datepicker-rtl .ui-datepicker-prev {
right: 2px;
left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next {
left: 2px;
right: auto;
}
.ui-datepicker-rtl .ui-datepicker-prev:hover {
right: 1px;
left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next:hover {
left: 1px;
right: auto;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane {
clear: right;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
float: left;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
.ui-datepicker-rtl .ui-datepicker-group {
float: right;
}
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
border-right-width: 0;
border-left-width: 1px;
}
/* Icons */
.ui-datepicker .ui-icon {
display: block;
text-indent: -99999px;
overflow: hidden;
background-repeat: no-repeat;
left: .5em;
top: .3em;
}
.ui-dialog {
position: absolute;
top: 0;
left: 0;
padding: .2em;
outline: 0;
}
.ui-dialog .ui-dialog-titlebar {
padding: .4em 1em;
position: relative;
}
.ui-dialog .ui-dialog-title {
float: left;
margin: .1em 0;
white-space: nowrap;
width: 90%;
overflow: hidden;
text-overflow: ellipsis;
}
.ui-dialog .ui-dialog-titlebar-close {
position: absolute;
right: .3em;
top: 50%;
width: 20px;
margin: -10px 0 0 0;
padding: 1px;
height: 20px;
}
.ui-dialog .ui-dialog-content {
position: relative;
border: 0;
padding: .5em 1em;
background: none;
overflow: auto;
}
.ui-dialog .ui-dialog-buttonpane {
text-align: left;
border-width: 1px 0 0 0;
background-image: none;
margin-top: .5em;
padding: .3em 1em .5em .4em;
}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
float: right;
}
.ui-dialog .ui-dialog-buttonpane button {
margin: .5em .4em .5em 0;
cursor: pointer;
}
.ui-dialog .ui-resizable-n {
height: 2px;
top: 0;
}
.ui-dialog .ui-resizable-e {
width: 2px;
right: 0;
}
.ui-dialog .ui-resizable-s {
height: 2px;
bottom: 0;
}
.ui-dialog .ui-resizable-w {
width: 2px;
left: 0;
}
.ui-dialog .ui-resizable-se,
.ui-dialog .ui-resizable-sw,
.ui-dialog .ui-resizable-ne,
.ui-dialog .ui-resizable-nw {
width: 7px;
height: 7px;
}
.ui-dialog .ui-resizable-se {
right: 0;
bottom: 0;
}
.ui-dialog .ui-resizable-sw {
left: 0;
bottom: 0;
}
.ui-dialog .ui-resizable-ne {
right: 0;
top: 0;
}
.ui-dialog .ui-resizable-nw {
left: 0;
top: 0;
}
.ui-draggable .ui-dialog-titlebar {
cursor: move;
}
.ui-draggable-handle {
-ms-touch-action: none;
touch-action: none;
}
.ui-resizable {
position: relative;
}
.ui-resizable-handle {
position: absolute;
font-size: 0.1px;
display: block;
-ms-touch-action: none;
touch-action: none;
}
.ui-resizable-disabled .ui-resizable-handle,
.ui-resizable-autohide .ui-resizable-handle {
display: none;
}
.ui-resizable-n {
cursor: n-resize;
height: 7px;
width: 100%;
top: -5px;
left: 0;
}
.ui-resizable-s {
cursor: s-resize;
height: 7px;
width: 100%;
bottom: -5px;
left: 0;
}
.ui-resizable-e {
cursor: e-resize;
width: 7px;
right: -5px;
top: 0;
height: 100%;
}
.ui-resizable-w {
cursor: w-resize;
width: 7px;
left: -5px;
top: 0;
height: 100%;
}
.ui-resizable-se {
cursor: se-resize;
width: 12px;
height: 12px;
right: 1px;
bottom: 1px;
}
.ui-resizable-sw {
cursor: sw-resize;
width: 9px;
height: 9px;
left: -5px;
bottom: -5px;
}
.ui-resizable-nw {
cursor: nw-resize;
width: 9px;
height: 9px;
left: -5px;
top: -5px;
}
.ui-resizable-ne {
cursor: ne-resize;
width: 9px;
height: 9px;
right: -5px;
top: -5px;
}
.ui-progressbar {
height: 2em;
text-align: left;
overflow: hidden;
}
.ui-progressbar .ui-progressbar-value {
margin: -1px;
height: 100%;
}
.ui-progressbar .ui-progressbar-overlay {
background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
height: 100%;
filter: alpha(opacity=25); /* support: IE8 */
opacity: 0.25;
}
.ui-progressbar-indeterminate .ui-progressbar-value {
background-image: none;
}
.ui-selectable {
-ms-touch-action: none;
touch-action: none;
}
.ui-selectable-helper {
position: absolute;
z-index: 100;
border: 1px dotted black;
}
.ui-selectmenu-menu {
padding: 0;
margin: 0;
position: absolute;
top: 0;
left: 0;
display: none;
}
.ui-selectmenu-menu .ui-menu {
overflow: auto;
overflow-x: hidden;
padding-bottom: 1px;
}
.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
font-size: 1em;
font-weight: bold;
line-height: 1.5;
padding: 2px 0.4em;
margin: 0.5em 0 0 0;
height: auto;
border: 0;
}
.ui-selectmenu-open {
display: block;
}
.ui-selectmenu-text {
display: block;
margin-right: 20px;
overflow: hidden;
text-overflow: ellipsis;
}
.ui-selectmenu-button.ui-button {
text-align: left;
white-space: nowrap;
width: 14em;
}
.ui-selectmenu-icon.ui-icon {
float: right;
margin-top: 0;
}
.ui-slider {
position: relative;
text-align: left;
}
.ui-slider .ui-slider-handle {
position: absolute;
z-index: 2;
width: 1.2em;
height: 1.2em;
cursor: default;
-ms-touch-action: none;
touch-action: none;
}
.ui-slider .ui-slider-range {
position: absolute;
z-index: 1;
font-size: .7em;
display: block;
border: 0;
background-position: 0 0;
}
/* support: IE8 - See #6727 */
.ui-slider.ui-state-disabled .ui-slider-handle,
.ui-slider.ui-state-disabled .ui-slider-range {
filter: inherit;
}
.ui-slider-horizontal {
height: .8em;
}
.ui-slider-horizontal .ui-slider-handle {
top: -.3em;
margin-left: -.6em;
}
.ui-slider-horizontal .ui-slider-range {
top: 0;
height: 100%;
}
.ui-slider-horizontal .ui-slider-range-min {
left: 0;
}
.ui-slider-horizontal .ui-slider-range-max {
right: 0;
}
.ui-slider-vertical {
width: .8em;
height: 100px;
}
.ui-slider-vertical .ui-slider-handle {
left: -.3em;
margin-left: 0;
margin-bottom: -.6em;
}
.ui-slider-vertical .ui-slider-range {
left: 0;
width: 100%;
}
.ui-slider-vertical .ui-slider-range-min {
bottom: 0;
}
.ui-slider-vertical .ui-slider-range-max {
top: 0;
}
.ui-sortable-handle {
-ms-touch-action: none;
touch-action: none;
}
.ui-spinner {
position: relative;
display: inline-block;
overflow: hidden;
padding: 0;
vertical-align: middle;
}
.ui-spinner-input {
border: none;
background: none;
color: inherit;
padding: .222em 0;
margin: .2em 0;
vertical-align: middle;
margin-left: .4em;
margin-right: 2em;
}
.ui-spinner-button {
width: 1.6em;
height: 50%;
font-size: .5em;
padding: 0;
margin: 0;
text-align: center;
position: absolute;
cursor: default;
display: block;
overflow: hidden;
right: 0;
}
/* more specificity required here to override default borders */
.ui-spinner a.ui-spinner-button {
border-top-style: none;
border-bottom-style: none;
border-right-style: none;
}
.ui-spinner-up {
top: 0;
}
.ui-spinner-down {
bottom: 0;
}
.ui-tabs {
position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
padding: .2em;
}
.ui-tabs .ui-tabs-nav {
margin: 0;
padding: .2em .2em 0;
}
.ui-tabs .ui-tabs-nav li {
list-style: none;
float: left;
position: relative;
top: 0;
margin: 1px .2em 0 0;
border-bottom-width: 0;
padding: 0;
white-space: nowrap;
}
.ui-tabs .ui-tabs-nav .ui-tabs-anchor {
float: left;
padding: .5em 1em;
text-decoration: none;
}
.ui-tabs .ui-tabs-nav li.ui-tabs-active {
margin-bottom: -1px;
padding-bottom: 1px;
}
.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
cursor: text;
}
.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
cursor: pointer;
}
.ui-tabs .ui-tabs-panel {
display: block;
border-width: 0;
padding: 1em 1.4em;
background: none;
}
.ui-tooltip {
padding: 8px;
position: absolute;
z-index: 9999;
max-width: 300px;
}
body .ui-tooltip {
border-width: 2px;
}

443
resources/css/jquery-ui.theme.css vendored Normal file
View File

@ -0,0 +1,443 @@
/*!
* jQuery UI CSS Framework 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/category/theming/
*
* To view and modify this theme, visit http://jqueryui.com/themeroller/?bgShadowXPos=&bgOverlayXPos=&bgErrorXPos=&bgHighlightXPos=&bgContentXPos=&bgHeaderXPos=&bgActiveXPos=&bgHoverXPos=&bgDefaultXPos=&bgShadowYPos=&bgOverlayYPos=&bgErrorYPos=&bgHighlightYPos=&bgContentYPos=&bgHeaderYPos=&bgActiveYPos=&bgHoverYPos=&bgDefaultYPos=&bgShadowRepeat=&bgOverlayRepeat=&bgErrorRepeat=&bgHighlightRepeat=&bgContentRepeat=&bgHeaderRepeat=&bgActiveRepeat=&bgHoverRepeat=&bgDefaultRepeat=&iconsHover=url(%22images%2Fui-icons_555555_256x240.png%22)&iconsHighlight=url(%22images%2Fui-icons_777620_256x240.png%22)&iconsHeader=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsError=url(%22images%2Fui-icons_cc0000_256x240.png%22)&iconsDefault=url(%22images%2Fui-icons_777777_256x240.png%22)&iconsContent=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsActive=url(%22images%2Fui-icons_ffffff_256x240.png%22)&bgImgUrlShadow=&bgImgUrlOverlay=&bgImgUrlHover=&bgImgUrlHighlight=&bgImgUrlHeader=&bgImgUrlError=&bgImgUrlDefault=&bgImgUrlContent=&bgImgUrlActive=&opacityFilterShadow=Alpha(Opacity%3D30)&opacityFilterOverlay=Alpha(Opacity%3D30)&opacityShadowPerc=30&opacityOverlayPerc=30&iconColorHover=%23555555&iconColorHighlight=%23777620&iconColorHeader=%23444444&iconColorError=%23cc0000&iconColorDefault=%23777777&iconColorContent=%23444444&iconColorActive=%23ffffff&bgImgOpacityShadow=0&bgImgOpacityOverlay=0&bgImgOpacityError=95&bgImgOpacityHighlight=55&bgImgOpacityContent=75&bgImgOpacityHeader=75&bgImgOpacityActive=65&bgImgOpacityHover=75&bgImgOpacityDefault=75&bgTextureShadow=flat&bgTextureOverlay=flat&bgTextureError=flat&bgTextureHighlight=flat&bgTextureContent=flat&bgTextureHeader=flat&bgTextureActive=flat&bgTextureHover=flat&bgTextureDefault=flat&cornerRadius=3px&fwDefault=normal&ffDefault=Arial%2CHelvetica%2Csans-serif&fsDefault=1em&cornerRadiusShadow=8px&thicknessShadow=5px&offsetLeftShadow=0px&offsetTopShadow=0px&opacityShadow=.3&bgColorShadow=%23666666&opacityOverlay=.3&bgColorOverlay=%23aaaaaa&fcError=%235f3f3f&borderColorError=%23f1a899&bgColorError=%23fddfdf&fcHighlight=%23777620&borderColorHighlight=%23dad55e&bgColorHighlight=%23fffa90&fcContent=%23333333&borderColorContent=%23dddddd&bgColorContent=%23ffffff&fcHeader=%23333333&borderColorHeader=%23dddddd&bgColorHeader=%23e9e9e9&fcActive=%23ffffff&borderColorActive=%23003eff&bgColorActive=%23007fff&fcHover=%232b2b2b&borderColorHover=%23cccccc&bgColorHover=%23ededed&fcDefault=%23454545&borderColorDefault=%23c5c5c5&bgColorDefault=%23f6f6f6
*/
/* Component containers
----------------------------------*/
.ui-widget {
font-family: Arial,Helvetica,sans-serif;
font-size: 1em;
}
.ui-widget .ui-widget {
font-size: 1em;
}
.ui-widget input,
.ui-widget select,
.ui-widget textarea,
.ui-widget button {
font-family: Arial,Helvetica,sans-serif;
font-size: 1em;
}
.ui-widget.ui-widget-content {
border: 1px solid #c5c5c5;
}
.ui-widget-content {
border: 1px solid #dddddd;
background: #ffffff;
color: #333333;
}
.ui-widget-content a {
color: #333333;
}
.ui-widget-header {
border: 1px solid #dddddd;
background: #e9e9e9;
color: #333333;
font-weight: bold;
}
.ui-widget-header a {
color: #333333;
}
/* Interaction states
----------------------------------*/
.ui-state-default,
.ui-widget-content .ui-state-default,
.ui-widget-header .ui-state-default,
.ui-button,
/* We use html here because we need a greater specificity to make sure disabled
works properly when clicked or hovered */
html .ui-button.ui-state-disabled:hover,
html .ui-button.ui-state-disabled:active {
border: 1px solid #c5c5c5;
background: #f6f6f6;
font-weight: normal;
color: #454545;
}
.ui-state-default a,
.ui-state-default a:link,
.ui-state-default a:visited,
a.ui-button,
a:link.ui-button,
a:visited.ui-button,
.ui-button {
color: #454545;
text-decoration: none;
}
.ui-state-hover,
.ui-widget-content .ui-state-hover,
.ui-widget-header .ui-state-hover,
.ui-state-focus,
.ui-widget-content .ui-state-focus,
.ui-widget-header .ui-state-focus,
.ui-button:hover,
.ui-button:focus {
border: 1px solid #cccccc;
background: #ededed;
font-weight: normal;
color: #2b2b2b;
}
.ui-state-hover a,
.ui-state-hover a:hover,
.ui-state-hover a:link,
.ui-state-hover a:visited,
.ui-state-focus a,
.ui-state-focus a:hover,
.ui-state-focus a:link,
.ui-state-focus a:visited,
a.ui-button:hover,
a.ui-button:focus {
color: #2b2b2b;
text-decoration: none;
}
.ui-visual-focus {
box-shadow: 0 0 3px 1px rgb(94, 158, 214);
}
.ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active,
a.ui-button:active,
.ui-button:active,
.ui-button.ui-state-active:hover {
border: 1px solid #003eff;
background: #007fff;
font-weight: normal;
color: #ffffff;
}
.ui-icon-background,
.ui-state-active .ui-icon-background {
border: #003eff;
background-color: #ffffff;
}
.ui-state-active a,
.ui-state-active a:link,
.ui-state-active a:visited {
color: #ffffff;
text-decoration: none;
}
/* Interaction Cues
----------------------------------*/
.ui-state-highlight,
.ui-widget-content .ui-state-highlight,
.ui-widget-header .ui-state-highlight {
border: 1px solid #dad55e;
background: #fffa90;
color: #777620;
}
.ui-state-checked {
border: 1px solid #dad55e;
background: #fffa90;
}
.ui-state-highlight a,
.ui-widget-content .ui-state-highlight a,
.ui-widget-header .ui-state-highlight a {
color: #777620;
}
.ui-state-error,
.ui-widget-content .ui-state-error,
.ui-widget-header .ui-state-error {
border: 1px solid #f1a899;
background: #fddfdf;
color: #5f3f3f;
}
.ui-state-error a,
.ui-widget-content .ui-state-error a,
.ui-widget-header .ui-state-error a {
color: #5f3f3f;
}
.ui-state-error-text,
.ui-widget-content .ui-state-error-text,
.ui-widget-header .ui-state-error-text {
color: #5f3f3f;
}
.ui-priority-primary,
.ui-widget-content .ui-priority-primary,
.ui-widget-header .ui-priority-primary {
font-weight: bold;
}
.ui-priority-secondary,
.ui-widget-content .ui-priority-secondary,
.ui-widget-header .ui-priority-secondary {
opacity: .7;
filter:Alpha(Opacity=70); /* support: IE8 */
font-weight: normal;
}
.ui-state-disabled,
.ui-widget-content .ui-state-disabled,
.ui-widget-header .ui-state-disabled {
opacity: .35;
filter:Alpha(Opacity=35); /* support: IE8 */
background-image: none;
}
.ui-state-disabled .ui-icon {
filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
}
/* Icons
----------------------------------*/
/* states and images */
.ui-icon {
width: 16px;
height: 16px;
}
.ui-icon,
.ui-widget-content .ui-icon {
background-image: url("images/ui-icons_444444_256x240.png");
}
.ui-widget-header .ui-icon {
background-image: url("images/ui-icons_444444_256x240.png");
}
.ui-state-hover .ui-icon,
.ui-state-focus .ui-icon,
.ui-button:hover .ui-icon,
.ui-button:focus .ui-icon {
background-image: url("images/ui-icons_555555_256x240.png");
}
.ui-state-active .ui-icon,
.ui-button:active .ui-icon {
background-image: url("images/ui-icons_ffffff_256x240.png");
}
.ui-state-highlight .ui-icon,
.ui-button .ui-state-highlight.ui-icon {
background-image: url("images/ui-icons_777620_256x240.png");
}
.ui-state-error .ui-icon,
.ui-state-error-text .ui-icon {
background-image: url("images/ui-icons_cc0000_256x240.png");
}
.ui-button .ui-icon {
background-image: url("images/ui-icons_777777_256x240.png");
}
/* positioning */
.ui-icon-blank { background-position: 16px 16px; }
.ui-icon-caret-1-n { background-position: 0 0; }
.ui-icon-caret-1-ne { background-position: -16px 0; }
.ui-icon-caret-1-e { background-position: -32px 0; }
.ui-icon-caret-1-se { background-position: -48px 0; }
.ui-icon-caret-1-s { background-position: -65px 0; }
.ui-icon-caret-1-sw { background-position: -80px 0; }
.ui-icon-caret-1-w { background-position: -96px 0; }
.ui-icon-caret-1-nw { background-position: -112px 0; }
.ui-icon-caret-2-n-s { background-position: -128px 0; }
.ui-icon-caret-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -65px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -65px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 1px -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-on { background-position: -96px -144px; }
.ui-icon-radio-off { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-start { background-position: -80px -160px; }
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
/* Misc visuals
----------------------------------*/
/* Corner radius */
.ui-corner-all,
.ui-corner-top,
.ui-corner-left,
.ui-corner-tl {
border-top-left-radius: 3px;
}
.ui-corner-all,
.ui-corner-top,
.ui-corner-right,
.ui-corner-tr {
border-top-right-radius: 3px;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-left,
.ui-corner-bl {
border-bottom-left-radius: 3px;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-right,
.ui-corner-br {
border-bottom-right-radius: 3px;
}
/* Overlays */
.ui-widget-overlay {
background: #aaaaaa;
opacity: .003;
filter: Alpha(Opacity=.3); /* support: IE8 */
}
.ui-widget-shadow {
-webkit-box-shadow: 0px 0px 5px #666666;
box-shadow: 0px 0px 5px #666666;
}

214
resources/css/main.css Normal file
View File

@ -0,0 +1,214 @@
*{
border: 0;
margin: 0;
padding: 0;
}
a, a:visited {
color: white;
text-decoration: none;
}
body {
position: relative;
background: #151515;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12px;
}
#err {
margin: auto;
width: 200px;
padding: 5px;
text-align: center;
background: red;
color: white;
}
#loading {
display: none;
position: fixed;
padding: 50px 100px 50px 100px;
border: 1px solid white;
background: #333;
color: white;
top: 100px;
left: 40%;
}
.menu_title {
margin: 0;
padding: 2px;
border: 1px solid black;
background: #444;
color: white;
text-transform: uppercase;
font-size: 11px;
font-weight: bold;
}
.menu_item a,
.menu_item a:visited {
color: #bbb;
font-style: none;
text-decoration: none;
}
.menu_item {
padding: 2px;
margin: 5px;
}
.menu_item:hover {
background: #666;
}
.menu_item:hover a,
.menu_item:hover a:visited {
color: white;
}
.content_title {
margin: auto;
padding: 20px;
}
.content_title,
.content_title a,
.content_title a:visited {
font-size: 30px;
font-style: italic;
color: white;
}
.content_title a:hover {
text-decoration: underline;
}
.thumb {
text-align: center;
position: relative;
}
.thumb img {
max-width: 90%;
max-height: 90%;
border: 2px solid black;
}
.thumb:hover img {
border-color: yellow;
cursor: pointer;
}
#breadcrumbs {
background: black;
position: fixed;
top: 0;
left: 0;
right: 0;
-webkit-box-shadow: rgb(0, 0, 0) 0px 0px 8px 2px;
box-shadow: 0 0 8px black;
z-index: 100;
}
#content {
margin-top: 80px;
padding: 20px;
overflow: auto;
}
#menu {
visibility: hidden;
position: absolute;
left: 0px;
width: 200px;
top: 0px;
bottom: 0px;
bottom: 0;
background: #333;
overflow:auto;
}
#dirs, #thumbs {
text-align: center;
margin: auto;
}
#viewer {
display: none;
position: fixed;
top: 150px;
left: 0;
right: 0;
text-align: center;
height: 50%;
}
#viewer img {
max-height: 100%;
max-width: 80%;
border: 1px solid black;
-webkit-box-shadow: rgb(0, 0, 0) 0px 0px 8px 2px;
box-shadow: 0 0 8px black;
}
.thumb {
display: inline-block;
width: 250px;
height: 160px;
text-align: center;
margin: 0px 1px 10px 1px;
}
.thumb img {
-webkit-box-shadow: rgb(0, 0, 0) 0px 0px 8px 2px;
box-shadow: 0 0 8px black;
}
.folder {
display: inline-block;
position: relative;
width: 300px;
height: 160px;
background: blue;
margin: 20px;
-webkit-box-shadow: rgb(0, 0, 0) 0px 0px 8px 2px;
box-shadow: 0 0 8px black;
background-size: contain;
cursor: pointer;
border: 2px solid black;
}
.folder:hover {
border: 2px solid rgb(80, 140, 200);
}
.folder .title {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 3px;
background: rgba(0, 0, 0, 0.5);
text-align: center;
}
.folder .new {
position: absolute;
bottom: 0px;
left: 0px;
right: 0px;
padding: 0px;
width: 1px;
height: 1px;
border-style: solid;
border-width: 0 50px 50px 0;
border-color: transparent rgba(255, 255, 57, 0.4) transparent transparent;
text-align: right;
}
.thumb.new a img {
border-color: rgb(255, 255, 57);
}

28
resources/js/main.js Normal file
View File

@ -0,0 +1,28 @@
function updateURL( URL, Name) {
if (typeof history.pushState == 'function' ) {
var stateObj = { foo: "bar" };
history.pushState( stateObj, "Obsidian - " + Name, URL);
}
}
$("document").ready(function() {
$(".folder").click(function() {
$("#loading").show();
title = encodeURI($(this).children(".title").children("a").attr("href"));
Name = $(this).children(".title").children("a").html();
$("body").load(title);
updateURL(title, Name);
});
$(".thumb").click(function() {
title = encodeURI($(this).children("a").attr("bref"));
$("#lightbox").html('<img src="' + title + '">');
$("#viewer").fadeIn();
return false;
});
$("#container").click(function() {
$("#viewer").fadeOut();
});
});

18706
resources/libs/jquery-ui.js vendored Normal file

File diff suppressed because it is too large Load Diff

10872
resources/libs/jquery.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,247 @@
<?php
/**
* PhpThumb Library Definition File
*
* This file contains the definitions for the PhpThumb class.
*
* PHP Version 5 with GD 2.0+
* PhpThumb : PHP Thumb Library <http://phpthumb.gxdlabs.com>
* Copyright (c) 2009, Ian Selby/Gen X Design
*
* Author(s): Ian Selby <ian@gen-x-design.com>
*
* Licensed under the MIT License
* Redistributions of files must retain the above copyright notice.
*
* @author Ian Selby <ian@gen-x-design.com>
* @copyright Copyright (c) 2009 Gen X Design
* @link http://phpthumb.gxdlabs.com
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @version 3.0
* @package PhpThumb
* @filesource
*/
/**
* PhpThumb Object
*
* This singleton object is essentially a function library that helps with core validation
* and loading of the core classes and plugins. There isn't really any need to access it directly,
* unless you're developing a plugin and need to take advantage of any of the functionality contained
* within.
*
* If you're not familiar with singleton patterns, here's how you get an instance of this class (since you
* can't create one via the new keyword):
* <code>$pt = PhpThumb::getInstance();</code>
*
* It's that simple! Outside of that, there's no need to modify anything within this class, unless you're doing
* some crazy customization... then knock yourself out! :)
*
* @package PhpThumb
* @subpackage Core
*/
class PhpThumb
{
/**
* Instance of self
*
* @var object PhpThumb
*/
protected static $_instance;
/**
* The plugin registry
*
* This is where all plugins to be loaded are stored. Data about the plugin is
* provided, and currently consists of:
* - loaded: true/false
* - implementation: gd/imagick/both
*
* @var array
*/
protected $_registry;
/**
* What implementations are available
*
* This stores what implementations are available based on the loaded
* extensions in PHP, NOT whether or not the class files are present.
*
* @var array
*/
protected $_implementations;
/**
* Returns an instance of self
*
* This is the usual singleton function that returns / instantiates the object
*
* @return PhpThumb
*/
public static function getInstance ()
{
if(!(self::$_instance instanceof self))
{
self::$_instance = new self();
}
return self::$_instance;
}
/**
* Class constructor
*
* Initializes all the variables, and does some preliminary validation / checking of stuff
*
*/
private function __construct ()
{
$this->_registry = array();
$this->_implementations = array('gd' => false, 'imagick' => false);
$this->getImplementations();
}
/**
* Finds out what implementations are available
*
* This function loops over $this->_implementations and validates that the required extensions are loaded.
*
* I had planned on attempting to load them dynamically via dl(), but that would provide more overhead than I
* was comfortable with (and would probably fail 99% of the time anyway)
*
*/
private function getImplementations ()
{
foreach($this->_implementations as $extension => $loaded)
{
if($loaded)
{
continue;
}
if(extension_loaded($extension))
{
$this->_implementations[$extension] = true;
}
}
}
/**
* Returns whether or not $implementation is valid (available)
*
* If 'all' is passed, true is only returned if ALL implementations are available.
*
* You can also pass 'n/a', which always returns true
*
* @return bool
* @param string $implementation
*/
public function isValidImplementation ($implementation)
{
if ($implementation == 'n/a')
{
return true;
}
if ($implementation == 'all')
{
foreach ($this->_implementations as $imp => $value)
{
if ($value == false)
{
return false;
}
}
return true;
}
if (array_key_exists($implementation, $this->_implementations))
{
return $this->_implementations[$implementation];
}
return false;
}
/**
* Registers a plugin in the registry
*
* Adds a plugin to the registry if it isn't already loaded, and if the provided
* implementation is valid. Note that you can pass the following special keywords
* for implementation:
* - all - Requires that all implementations be available
* - n/a - Doesn't require any implementation
*
* When a plugin is added to the registry, it's added as a key on $this->_registry with the value
* being an array containing the following keys:
* - loaded - whether or not the plugin has been "loaded" into the core class
* - implementation - what implementation this plugin is valid for
*
* @return bool
* @param string $pluginName
* @param string $implementation
*/
public function registerPlugin ($pluginName, $implementation)
{
if (!array_key_exists($pluginName, $this->_registry) && $this->isValidImplementation($implementation))
{
$this->_registry[$pluginName] = array('loaded' => false, 'implementation' => $implementation);
return true;
}
return false;
}
/**
* Loads all the plugins in $pluginPath
*
* All this function does is include all files inside the $pluginPath directory. The plugins themselves
* will not be added to the registry unless you've properly added the code to do so inside your plugin file.
*
* @param string $pluginPath
*/
public function loadPlugins ($pluginPath)
{
// strip the trailing slash if present
if (substr($pluginPath, strlen($pluginPath) - 1, 1) == '/')
{
$pluginPath = substr($pluginPath, 0, strlen($pluginPath) - 1);
}
if ($handle = opendir($pluginPath))
{
while (false !== ($file = readdir($handle)))
{
if ($file == '.' || $file == '..' || $file == '.svn')
{
continue;
}
include_once($pluginPath . '/' . $file);
}
}
}
/**
* Returns the plugin registry for the supplied implementation
*
* @return array
* @param string $implementation
*/
public function getPluginRegistry ($implementation)
{
$returnArray = array();
foreach ($this->_registry as $plugin => $meta)
{
if ($meta['implementation'] == 'n/a' || $meta['implementation'] == $implementation)
{
$returnArray[$plugin] = $meta;
}
}
return $returnArray;
}
}

View File

@ -0,0 +1,323 @@
<?php
/**
* PhpThumb Base Class Definition File
*
* This file contains the definition for the ThumbBase object
*
* PHP Version 5 with GD 2.0+
* PhpThumb : PHP Thumb Library <http://phpthumb.gxdlabs.com>
* Copyright (c) 2009, Ian Selby/Gen X Design
*
* Author(s): Ian Selby <ian@gen-x-design.com>
*
* Licensed under the MIT License
* Redistributions of files must retain the above copyright notice.
*
* @author Ian Selby <ian@gen-x-design.com>
* @copyright Copyright (c) 2009 Gen X Design
* @link http://phpthumb.gxdlabs.com
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @version 3.0
* @package PhpThumb
* @filesource
*/
/**
* ThumbBase Class Definition
*
* This is the base class that all implementations must extend. It contains the
* core variables and functionality common to all implementations, as well as the functions that
* allow plugins to augment those classes.
*
* @package PhpThumb
* @subpackage Core
*/
abstract class ThumbBase
{
/**
* All imported objects
*
* An array of imported plugin objects
*
* @var array
*/
protected $imported;
/**
* All imported object functions
*
* An array of all methods added to this class by imported plugin objects
*
* @var array
*/
protected $importedFunctions;
/**
* The last error message raised
*
* @var string
*/
protected $errorMessage;
/**
* Whether or not the current instance has any errors
*
* @var bool
*/
protected $hasError;
/**
* The name of the file we're manipulating
*
* This must include the path to the file (absolute paths recommended)
*
* @var string
*/
protected $fileName;
/**
* What the file format is (mime-type)
*
* @var string
*/
protected $format;
/**
* Whether or not the image is hosted remotely
*
* @var bool
*/
protected $remoteImage;
/**
* Whether or not the current image is an actual file, or the raw file data
*
* By "raw file data" it's meant that we're actually passing the result of something
* like file_get_contents() or perhaps from a database blob
*
* @var bool
*/
protected $isDataStream;
/**
* Class constructor
*
* @return ThumbBase
*/
public function __construct ($fileName, $isDataStream = false)
{
$this->imported = array();
$this->importedFunctions = array();
$this->errorMessage = null;
$this->hasError = false;
$this->fileName = $fileName;
$this->remoteImage = false;
$this->isDataStream = $isDataStream;
$this->fileExistsAndReadable();
}
/**
* Imports plugins in $registry to the class
*
* @param array $registry
*/
public function importPlugins ($registry)
{
foreach ($registry as $plugin => $meta)
{
$this->imports($plugin);
}
}
/**
* Imports a plugin
*
* This is where all the plugins magic happens! This function "loads" the plugin functions, making them available as
* methods on the class.
*
* @param string $object The name of the object to import / "load"
*/
protected function imports ($object)
{
// the new object to import
$newImport = new $object();
// the name of the new object (class name)
$importName = get_class($newImport);
// the new functions to import
$importFunctions = get_class_methods($newImport);
// add the object to the registry
array_push($this->imported, array($importName, $newImport));
// add the methods to the registry
foreach ($importFunctions as $key => $functionName)
{
$this->importedFunctions[$functionName] = &$newImport;
}
}
/**
* Checks to see if $this->fileName exists and is readable
*
*/
protected function fileExistsAndReadable ()
{
if ($this->isDataStream === true)
{
return;
}
if (stristr($this->fileName, 'http://') !== false)
{
$this->remoteImage = true;
return;
}
if (!file_exists($this->fileName))
{
$this->triggerError('Image file not found: ' . $this->fileName);
}
elseif (!is_readable($this->fileName))
{
$this->triggerError('Image file not readable: ' . $this->fileName);
}
}
/**
* Sets $this->errorMessage to $errorMessage and throws an exception
*
* Also sets $this->hasError to true, so even if the exceptions are caught, we don't
* attempt to proceed with any other functions
*
* @param string $errorMessage
*/
protected function triggerError ($errorMessage)
{
$this->hasError = true;
$this->errorMessage = $errorMessage;
throw new Exception ($errorMessage);
}
/**
* Calls plugin / imported functions
*
* This is also where a fair amount of plugins magaic happens. This magic method is called whenever an "undefined" class
* method is called in code, and we use that to call an imported function.
*
* You should NEVER EVER EVER invoke this function manually. The universe will implode if you do... seriously ;)
*
* @param string $method
* @param array $args
*/
public function __call ($method, $args)
{
if( array_key_exists($method, $this->importedFunctions))
{
$args[] = $this;
return call_user_func_array(array($this->importedFunctions[$method], $method), $args);
}
throw new BadMethodCallException ('Call to undefined method/class function: ' . $method);
}
/**
* Returns $imported.
* @see ThumbBase::$imported
* @return array
*/
public function getImported ()
{
return $this->imported;
}
/**
* Returns $importedFunctions.
* @see ThumbBase::$importedFunctions
* @return array
*/
public function getImportedFunctions ()
{
return $this->importedFunctions;
}
/**
* Returns $errorMessage.
*
* @see ThumbBase::$errorMessage
*/
public function getErrorMessage ()
{
return $this->errorMessage;
}
/**
* Sets $errorMessage.
*
* @param object $errorMessage
* @see ThumbBase::$errorMessage
*/
public function setErrorMessage ($errorMessage)
{
$this->errorMessage = $errorMessage;
}
/**
* Returns $fileName.
*
* @see ThumbBase::$fileName
*/
public function getFileName ()
{
return $this->fileName;
}
/**
* Sets $fileName.
*
* @param object $fileName
* @see ThumbBase::$fileName
*/
public function setFileName ($fileName)
{
$this->fileName = $fileName;
}
/**
* Returns $format.
*
* @see ThumbBase::$format
*/
public function getFormat ()
{
return $this->format;
}
/**
* Sets $format.
*
* @param object $format
* @see ThumbBase::$format
*/
public function setFormat ($format)
{
$this->format = $format;
}
/**
* Returns $hasError.
*
* @see ThumbBase::$hasError
*/
public function getHasError ()
{
return $this->hasError;
}
/**
* Sets $hasError.
*
* @param object $hasError
* @see ThumbBase::$hasError
*/
public function setHasError ($hasError)
{
$this->hasError = $hasError;
}
}

View File

@ -0,0 +1,146 @@
<?php
/**
* PhpThumb Library Definition File
*
* This file contains the definitions for the PhpThumbFactory class.
* It also includes the other required base class files.
*
* If you've got some auto-loading magic going on elsewhere in your code, feel free to
* remove the include_once statements at the beginning of this file... just make sure that
* these files get included one way or another in your code.
*
* PHP Version 5 with GD 2.0+
* PhpThumb : PHP Thumb Library <http://phpthumb.gxdlabs.com>
* Copyright (c) 2009, Ian Selby/Gen X Design
*
* Author(s): Ian Selby <ian@gen-x-design.com>
*
* Licensed under the MIT License
* Redistributions of files must retain the above copyright notice.
*
* @author Ian Selby <ian@gen-x-design.com>
* @copyright Copyright (c) 2009 Gen X Design
* @link http://phpthumb.gxdlabs.com
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @version 3.0
* @package PhpThumb
* @filesource
*/
// define some useful constants
define('THUMBLIB_BASE_PATH', dirname(__FILE__));
define('THUMBLIB_PLUGIN_PATH', THUMBLIB_BASE_PATH . '/thumb_plugins/');
define('DEFAULT_THUMBLIB_IMPLEMENTATION', 'gd');
/**
* Include the PhpThumb Class
*/
require_once THUMBLIB_BASE_PATH . '/PhpThumb.inc.php';
/**
* Include the ThumbBase Class
*/
require_once THUMBLIB_BASE_PATH . '/ThumbBase.inc.php';
/**
* Include the GdThumb Class
*/
require_once THUMBLIB_BASE_PATH . '/GdThumb.inc.php';
/**
* PhpThumbFactory Object
*
* This class is responsible for making sure everything is set up and initialized properly,
* and returning the appropriate thumbnail class instance. It is the only recommended way
* of using this library, and if you try and circumvent it, the sky will fall on your head :)
*
* Basic use is easy enough. First, make sure all the settings meet your needs and environment...
* these are the static variables defined at the beginning of the class.
*
* Once that's all set, usage is pretty easy. You can simply do something like:
* <code>$thumb = PhpThumbFactory::create('/path/to/file.png');</code>
*
* Refer to the documentation for the create function for more information
*
* @package PhpThumb
* @subpackage Core
*/
class PhpThumbFactory
{
/**
* Which implemenation of the class should be used by default
*
* Currently, valid options are:
* - imagick
* - gd
*
* These are defined in the implementation map variable, inside the create function
*
* @var string
*/
public static $defaultImplemenation = DEFAULT_THUMBLIB_IMPLEMENTATION;
/**
* Where the plugins can be loaded from
*
* Note, it's important that this path is properly defined. It is very likely that you'll
* have to change this, as the assumption here is based on a relative path.
*
* @var string
*/
public static $pluginPath = THUMBLIB_PLUGIN_PATH;
/**
* Factory Function
*
* This function returns the correct thumbnail object, augmented with any appropriate plugins.
* It does so by doing the following:
* - Getting an instance of PhpThumb
* - Loading plugins
* - Validating the default implemenation
* - Returning the desired default implementation if possible
* - Returning the GD implemenation if the default isn't available
* - Throwing an exception if no required libraries are present
*
* @return GdThumb
* @uses PhpThumb
* @param string $filename The path and file to load [optional]
*/
public static function create ($filename = null, $options = array(), $isDataStream = false)
{
// map our implementation to their class names
$implementationMap = array
(
'imagick' => 'ImagickThumb',
'gd' => 'GdThumb'
);
// grab an instance of PhpThumb
$pt = PhpThumb::getInstance();
// load the plugins
$pt->loadPlugins(self::$pluginPath);
$toReturn = null;
$implementation = self::$defaultImplemenation;
// attempt to load the default implementation
if ($pt->isValidImplementation(self::$defaultImplemenation))
{
$imp = $implementationMap[self::$defaultImplemenation];
$toReturn = new $imp($filename, $options, $isDataStream);
}
// load the gd implementation if default failed
else if ($pt->isValidImplementation('gd'))
{
$imp = $implementationMap['gd'];
$implementation = 'gd';
$toReturn = new $imp($filename, $options, $isDataStream);
}
// throw an exception if we can't load
else
{
throw new Exception('You must have either the GD or iMagick extension loaded to use this library');
}
$registry = $pt->getPluginRegistry($implementation);
$toReturn->importPlugins($registry);
return $toReturn;
}
}

View File

@ -0,0 +1,180 @@
<?php
/**
* GD Reflection Lib Plugin Definition File
*
* This file contains the plugin definition for the GD Reflection Lib for PHP Thumb
*
* PHP Version 5 with GD 2.0+
* PhpThumb : PHP Thumb Library <http://phpthumb.gxdlabs.com>
* Copyright (c) 2009, Ian Selby/Gen X Design
*
* Author(s): Ian Selby <ian@gen-x-design.com>
*
* Licensed under the MIT License
* Redistributions of files must retain the above copyright notice.
*
* @author Ian Selby <ian@gen-x-design.com>
* @copyright Copyright (c) 2009 Gen X Design
* @link http://phpthumb.gxdlabs.com
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @version 3.0
* @package PhpThumb
* @filesource
*/
/**
* GD Reflection Lib Plugin
*
* This plugin allows you to create those fun Apple(tm)-style reflections in your images
*
* @package PhpThumb
* @subpackage Plugins
*/
class GdReflectionLib
{
/**
* Instance of GdThumb passed to this class
*
* @var GdThumb
*/
protected $parentInstance;
protected $currentDimensions;
protected $workingImage;
protected $newImage;
protected $options;
public function createReflection ($percent, $reflection, $white, $border, $borderColor, &$that)
{
// bring stuff from the parent class into this class...
$this->parentInstance = $that;
$this->currentDimensions = $this->parentInstance->getCurrentDimensions();
$this->workingImage = $this->parentInstance->getWorkingImage();
$this->newImage = $this->parentInstance->getOldImage();
$this->options = $this->parentInstance->getOptions();
$width = $this->currentDimensions['width'];
$height = $this->currentDimensions['height'];
$reflectionHeight = intval($height * ($reflection / 100));
$newHeight = $height + $reflectionHeight;
$reflectedPart = $height * ($percent / 100);
$this->workingImage = imagecreatetruecolor($width, $newHeight);
imagealphablending($this->workingImage, true);
$colorToPaint = imagecolorallocatealpha($this->workingImage,255,255,255,0);
imagefilledrectangle($this->workingImage,0,0,$width,$newHeight,$colorToPaint);
imagecopyresampled
(
$this->workingImage,
$this->newImage,
0,
0,
0,
$reflectedPart,
$width,
$reflectionHeight,
$width,
($height - $reflectedPart)
);
$this->imageFlipVertical();
imagecopy($this->workingImage, $this->newImage, 0, 0, 0, 0, $width, $height);
imagealphablending($this->workingImage, true);
for ($i = 0; $i < $reflectionHeight; $i++)
{
$colorToPaint = imagecolorallocatealpha($this->workingImage, 255, 255, 255, ($i/$reflectionHeight*-1+1)*$white);
imagefilledrectangle($this->workingImage, 0, $height + $i, $width, $height + $i, $colorToPaint);
}
if($border == true)
{
$rgb = $this->hex2rgb($borderColor, false);
$colorToPaint = imagecolorallocate($this->workingImage, $rgb[0], $rgb[1], $rgb[2]);
imageline($this->workingImage, 0, 0, $width, 0, $colorToPaint); //top line
imageline($this->workingImage, 0, $height, $width, $height, $colorToPaint); //bottom line
imageline($this->workingImage, 0, 0, 0, $height, $colorToPaint); //left line
imageline($this->workingImage, $width-1, 0, $width-1, $height, $colorToPaint); //right line
}
if ($this->parentInstance->getFormat() == 'PNG')
{
$colorTransparent = imagecolorallocatealpha
(
$this->workingImage,
$this->options['alphaMaskColor'][0],
$this->options['alphaMaskColor'][1],
$this->options['alphaMaskColor'][2],
0
);
imagefill($this->workingImage, 0, 0, $colorTransparent);
imagesavealpha($this->workingImage, true);
}
$this->parentInstance->setOldImage($this->workingImage);
$this->currentDimensions['width'] = $width;
$this->currentDimensions['height'] = $newHeight;
$this->parentInstance->setCurrentDimensions($this->currentDimensions);
return $that;
}
/**
* Flips the image vertically
*
*/
protected function imageFlipVertical ()
{
$x_i = imagesx($this->workingImage);
$y_i = imagesy($this->workingImage);
for ($x = 0; $x < $x_i; $x++)
{
for ($y = 0; $y < $y_i; $y++)
{
imagecopy($this->workingImage, $this->workingImage, $x, $y_i - $y - 1, $x, $y, 1, 1);
}
}
}
/**
* Converts a hex color to rgb tuples
*
* @return mixed
* @param string $hex
* @param bool $asString
*/
protected function hex2rgb ($hex, $asString = false)
{
// strip off any leading #
if (0 === strpos($hex, '#'))
{
$hex = substr($hex, 1);
}
elseif (0 === strpos($hex, '&H'))
{
$hex = substr($hex, 2);
}
// break into hex 3-tuple
$cutpoint = ceil(strlen($hex) / 2)-1;
$rgb = explode(':', wordwrap($hex, $cutpoint, ':', $cutpoint), 3);
// convert each tuple to decimal
$rgb[0] = (isset($rgb[0]) ? hexdec($rgb[0]) : 0);
$rgb[1] = (isset($rgb[1]) ? hexdec($rgb[1]) : 0);
$rgb[2] = (isset($rgb[2]) ? hexdec($rgb[2]) : 0);
return ($asString ? "{$rgb[0]} {$rgb[1]} {$rgb[2]}" : $rgb);
}
}
$pt = PhpThumb::getInstance();
$pt->registerPlugin('GdReflectionLib', 'gd');

90
templates/content.php Normal file
View File

@ -0,0 +1,90 @@
<div id="content">
<?php
/**
* We enumerate the folders and files, as a form of basic indexing.
*/
$categories = listFolders( $imagesFolder );
//echo "<span> cats: ". var_dump($categories) ."</span";
$pictures = listFiles( $imagesFolder );
//echo "<span> pics: ". var_dump($pictures) . "</span";
if ( count( $categories ) > 0 ) {
echo "<div id='categories'>\n";
foreach ( $categories as $category ) {
if (file_exists( $category."/.gridhide") ) {
continue;
}
$file = absoluteToRelative( $category, $imagesFolder );
$name = tidyName( $category );
$createFile = false;
foreach( $newImages as $entry ) {
$path = realpath( $category );
if( isInFolder( $path, $entry ) ) {
$createFile = true;
break;
}
}
$image = addslashes( absoluteToRelative( listFiles( $category, true, true), $imagesFolder ));
echo "<div class='folder' stlye='";
echo "background: url('?thumb=$image') no-repeat center center;";
echo "-webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;'>";
if( $createFile ) { ?>
<div class="new"></div>
<?php }
echo "<div class='title'> <a href='?category=$file'> $name </a> </div> </div>";
}?>
</div>
<?php
}
if( count( $pictures ) > 0 ) { ?>
<div id="thumbs">
<?php
foreach ($pictures as $file ) {
$picture = absoluteToRelative( $file, $imagesFolder);
$name = tidyName( $file );
$createFile = "";
foreach( $new as $entry ) {
$path = getPath( $file );
if( isInFolder( $path, $entry ) ) {
$createFile = "new";
break;
}
}
echo "<div class='thumb $createFile'> <a href='?image=$picture'> <img src='?thumb=$picture'> </a> </div>";
}?>
</div>
<?php
} ?>
</div>
<div id="viewer">
<div id="lightbox">
</div>
</div>
</div id="loading">
Loading.
</div>

5
templates/footer.php Normal file
View File

@ -0,0 +1,5 @@
</div> <?php // id="container" ?>
</body>
</html>

33
templates/header.php Normal file
View File

@ -0,0 +1,33 @@
<?php
/**
* This is the header file, imported by every page.
* It provides metadata, scripts and stylesheets.
*/
?>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html charset=utf-8">
<script src="resources/libs/jquery.js"></script>
<script src="resources/libs/jquery-ui.js"></script>
<script src="resources/js/main.js"></script>
<link rel="stylesheet" href="resources/css/main.css" />
<title>Obsidian PHP Proto</title>
</head>
<body>
<div id="container">
<?php
/**
* We need to show errors at the top, always.
*/
if( isset( $error ) ) { ?>
<div id="err">
<?php $err?>
</div>
<?php }?>

42
templates/menu.php Normal file
View File

@ -0,0 +1,42 @@
<?php
/**
* Get the list of paths taken to get to this screen
*/
$breadcrumbs = breadcrumbs( absoluteToRelative( $imagesFolder, $config["images"] ) );
/**
* Begin encoding them into the url. Files is always the current image.
*/
$url = "?file=.";
/**
* Switch to HTML, send out some divs.
* First, set up the home link,
* then iterate over the breadcrumbs and add them.
*
* This should create something like
* Home > Albums > Cat Pictures > Cat_01.png
*
*/ ?>
<div id="breadcrumbs">
<div class="content_title">
<a href=".">Home</a>
<?php foreach ($breadcrumbs as $b) {
$url = $url."/".$b;
/**
* Given the structure of the URL at this point
* (with each breadcrumb being incrementally added)
* We can use it to create a soft link to each stage,
* should the user want to go back.
*/
echo "> <a href=\"$url\">$b</a></li>";
} ?>
</div>
</div>