viewportOffset.top &&
+ elementOffset.top < viewportOffset.top + viewportSize.height &&
+ elementOffset.left + elementSize.width > viewportOffset.left &&
+ elementOffset.left < viewportOffset.left + viewportSize.width) {
+ visiblePartX = (viewportOffset.left > elementOffset.left ?
+ 'right' : (viewportOffset.left + viewportSize.width) < (elementOffset.left + elementSize.width) ?
+ 'left' : 'both');
+ visiblePartY = (viewportOffset.top > elementOffset.top ?
+ 'bottom' : (viewportOffset.top + viewportSize.height) < (elementOffset.top + elementSize.height) ?
+ 'top' : 'both');
+ visiblePartsMerged = visiblePartX + "-" + visiblePartY;
+ if (!inView || inView !== visiblePartsMerged) {
+ $element.data('inview', visiblePartsMerged).trigger('inview', [true, visiblePartX, visiblePartY]);
+ }
+ } else if (inView) {
+ $element.data('inview', false).trigger('inview', [false]);
+ }
+ }
+ }
+ }
+
+ $(w).bind("scroll resize", function() {
+ viewportSize = viewportOffset = null;
+ });
+
+ // Use setInterval in order to also make sure this captures elements within
+ // "overflow:scroll" elements or elements that appeared in the dom tree due to
+ // dom manipulation and reflow
+ // old: $(window).scroll(checkInView);
+ //
+ // By the way, iOS (iPad, iPhone, ...) seems to not execute, or at least delays
+ // intervals while the user scrolls. Therefore the inview event might fire a bit late there
+ setInterval(checkInView, 250);
+})(jQuery);
\ No newline at end of file
diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php
index 8592ffe1c4c..90143f25fa6 100644
--- a/apps/contacts/templates/index.php
+++ b/apps/contacts/templates/index.php
@@ -1,3 +1,10 @@
+
+
diff --git a/apps/contacts/thumbnail.php b/apps/contacts/thumbnail.php
new file mode 100644
index 00000000000..bf0a6e96a5d
--- /dev/null
+++ b/apps/contacts/thumbnail.php
@@ -0,0 +1,150 @@
+.
+ *
+ */
+
+// Init owncloud
+require_once('../../lib/base.php');
+OC_Util::checkLoggedIn();
+OC_Util::checkAppEnabled('contacts');
+
+if(!function_exists('imagecreatefromjpeg')) {
+ OC_Log::write('contacts','GD module not installed',OC_Log::ERROR);
+ header('Content-Type: image/png');
+ // TODO: Check if it works to read the file and echo the content.
+ return 'img/person.png';
+}
+
+function getStandardImage(){
+ $src_img = imagecreatefrompng('img/person.png');
+ header('Content-Type: image/png');
+ imagepng($src_img);
+ imagedestroy($src_img);
+}
+
+
+$id = $_GET['id'];
+
+$l10n = new OC_L10N('contacts');
+
+$card = OC_Contacts_VCard::find( $id );
+if( $card === false ){
+ echo $l10n->t('Contact could not be found.');
+ exit();
+}
+
+$addressbook = OC_Contacts_Addressbook::find( $card['addressbookid'] );
+if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
+ echo $l10n->t('This is not your contact.'); // This is a weird error, why would it come up? (Better feedback for users?)
+ exit();
+}
+
+$content = OC_VObject::parse($card['carddata']);
+
+// invalid vcard
+if( is_null($content)){
+ echo $l10n->t('This card is not RFC compatible.');
+ exit();
+}
+
+// define the width and height for the thumbnail
+// note that theese dimmensions are considered the maximum dimmension and are not fixed,
+// because we have to keep the image ratio intact or it will be deformed
+$thumbnail_width = 23;
+$thumbnail_height = 23;
+
+// Photo :-)
+foreach($content->children as $child){
+ if($child->name == 'PHOTO'){
+ foreach($child->parameters as $parameter){
+ if( $parameter->name == 'TYPE' ){
+ $mime = $parameter->value;
+ }
+ }
+ $data = base64_decode($child->value);
+ $src_img = imagecreatefromstring($data);
+ if ($src_img !== false) {
+ //gets the dimmensions of the image
+ $width_orig=imageSX($src_img);
+ $height_orig=imageSY($src_img);
+ $ratio_orig = $width_orig/$height_orig;
+
+ if ($thumbnail_width/$thumbnail_height > $ratio_orig) {
+ $new_height = $thumbnail_width/$ratio_orig;
+ $new_width = $thumbnail_width;
+ } else {
+ $new_width = $thumbnail_height*$ratio_orig;
+ $new_height = $thumbnail_height;
+ }
+
+ $x_mid = $new_width/2; //horizontal middle
+ $y_mid = $new_height/2; //vertical middle
+
+ $process = imagecreatetruecolor(round($new_width), round($new_height));
+ if ($process == false) {
+ getStandardImage();
+ //echo 'Error creating process image: '.$new_width.'x'.$new_height;
+ OC_Log::write('contacts','Error creating process image for '.$id.' '.$new_width.'x'.$new_height,OC_Log::ERROR);
+ imagedestroy($process);
+ imagedestroy($src_img);
+ exit();
+ }
+
+ imagecopyresampled($process, $src_img, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);
+ if ($process == false) {
+ getStandardImage();
+ //echo 'Error resampling process image: '.$new_width.'x'.$new_height;
+ OC_Log::write('contacts','Error resampling process image for '.$id.' '.$new_width.'x'.$new_height,OC_Log::ERROR);
+ imagedestroy($process);
+ imagedestroy($src_img);
+ exit();
+ }
+ $thumb = imagecreatetruecolor($thumbnail_width, $thumbnail_height);
+ if ($process == false) {
+ getStandardImage();
+ //echo 'Error creating thumb image: '.$thumbnail_width.'x'.$thumbnail_height;
+ OC_Log::write('contacts','Error creating thumb image for '.$id.' '.$thumbnail_width.'x'.$thumbnail_height,OC_Log::ERROR);
+ imagedestroy($process);
+ imagedestroy($src_img);
+ exit();
+ }
+ imagecopyresampled($thumb, $process, 0, 0, ($x_mid-($thumbnail_width/2)), ($y_mid-($thumbnail_height/2)), $thumbnail_width, $thumbnail_height, $thumbnail_width, $thumbnail_height);
+ if ($thumb !== false) {
+ header('Content-Type: image/png');
+ imagepng($thumb);
+ } else {
+ getStandardImage();
+ OC_Log::write('contacts','Error resampling thumb image for '.$id.' '.$thumbnail_width.'x'.$thumbnail_height,OC_Log::ERROR);
+ //echo 'An error occurred resampling thumb.';
+ }
+ imagedestroy($thumb);
+ imagedestroy($process);
+ imagedestroy($src_img);
+ }
+ else {
+ getStandardImage();
+ }
+ exit();
+ }
+}
+getStandardImage();
+
+// Not found :-(
+//echo $l10n->t('This card does not contain a photo.');
diff --git a/apps/gallery/css/styles.css b/apps/gallery/css/styles.css
index 09f9daeb6b1..53c3c0901d9 100644
--- a/apps/gallery/css/styles.css
+++ b/apps/gallery/css/styles.css
@@ -17,7 +17,14 @@ div#gallery_album_box {
padding: 10px;
border: solid 1px black;
position: relative;
+ overflow: hidden;
+ color: #999;
}
+
+div#gallery_album_box:hover {
+ color: black;
+}
+
.leftcontent div#gallery_album_box {
margin: 5px;
}
diff --git a/apps/gallery/lib/scanner.php b/apps/gallery/lib/scanner.php
index ef210327966..59c34b8e69a 100644
--- a/apps/gallery/lib/scanner.php
+++ b/apps/gallery/lib/scanner.php
@@ -21,7 +21,9 @@ class OC_Gallery_Scanner {
public static function scanDir($path, &$albums) {
$current_album = array('name'=> $path, 'imagesCount' => 0, 'images' => array());
$current_album['name'] = str_replace('/', '.', str_replace(OC::$CONFIG_DATADIRECTORY, '', $current_album['name']));
- $current_album['name'] = ($current_album['name']==='')?'main':$current_album['name'];
+ $current_album['name'] = ($current_album['name']==='') ?
+ 'main' :
+ trim($current_album['name'],'.');
if ($dh = OC_Filesystem::opendir($path)) {
while (($filename = readdir($dh)) !== false) {
diff --git a/files/index.php b/files/index.php
index 189917150ad..fc69a42bec6 100644
--- a/files/index.php
+++ b/files/index.php
@@ -71,7 +71,7 @@ $breadcrumb = array();
$pathtohere = "";
foreach( explode( "/", $dir ) as $i ){
if( $i != "" ){
- $pathtohere .= "/".urlencode($i);
+ $pathtohere .= "/".str_replace('+','%20', urlencode($i));
$breadcrumb[] = array( "dir" => $pathtohere, "name" => $i );
}
}
diff --git a/files/js/filelist.js b/files/js/filelist.js
index 16f73ed58d6..35847e06dfe 100644
--- a/files/js/filelist.js
+++ b/files/js/filelist.js
@@ -40,7 +40,7 @@ FileList={
html = $('
').attr({ "data-type": "dir", "data-size": size, "data-file": name});
td = $(' | ').attr({"class": "filename", "style": 'background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')' });
td.append('');
- var link_elem = $('').attr({ "class": "name", "href": "index.php?dir="+ encodeURIComponent($('#dir').val()+'/'+name) });
+ var link_elem = $('').attr({ "class": "name", "href": "index.php?dir="+ encodeURIComponent($('#dir').val()+'/'+name).replace(/%2F/g, '/') });
link_elem.append($('').addClass('nametext').text(name));
td.append(link_elem);
html.append(td);
@@ -136,6 +136,8 @@ FileList={
var newname=input.val();
tr.attr('data-file',newname);
td.children('a.name').empty();
+ var path = td.children('a.name').attr('href');
+ td.children('a.name').attr('href', path.replace(encodeURIComponent(name), encodeURIComponent(newname)));
if(newname.indexOf('.')>0){
basename=newname.substr(0,newname.lastIndexOf('.'));
}else{
diff --git a/files/templates/part.list.php b/files/templates/part.list.php
index 157ec4ef42c..ae3f32b2e9f 100644
--- a/files/templates/part.list.php
+++ b/files/templates/part.list.php
@@ -4,11 +4,15 @@
if($simple_size_color<0) $simple_size_color = 0;
$relative_modified_date = relative_modified_date($file['mtime']);
$relative_date_color = round((time()-$file['mtime'])/60/60/24*14); // the older the file, the brighter the shade of grey; days*14
- if($relative_date_color>200) $relative_date_color = 200; ?>
- '>
+ if($relative_date_color>200) $relative_date_color = 200;
+ $name = str_replace('+','%20',urlencode($file['name']));
+ $name = str_replace('%2F','/', $name);
+ $directory = str_replace('+','%20',urlencode($file['directory']));
+ $directory = str_replace('%2F','/', $directory); ?>
+
'>
-
+
diff --git a/lib/util.php b/lib/util.php
index 0f79948bc24..9cf78da6e90 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -175,8 +175,8 @@ class OC_Util {
$errors=array();
//check for database drivers
- if(!is_callable('sqlite_open') and !is_callable('mysql_connect')){
- $errors[]=array('error'=>'No database drivers (sqlite or mysql) installed. ','hint'=>'');//TODO: sane hint
+ if(!is_callable('sqlite_open') and !is_callable('mysql_connect') and !is_callable('pg_connect')){
+ $errors[]=array('error'=>'No database drivers (sqlite, mysql, or postgresql) installed. ','hint'=>'');//TODO: sane hint
}
$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
$CONFIG_DBNAME = OC_Config::getValue( "dbname", "owncloud" );
|