From dee7fb3b722388c30a5ca3e69fb3cf846bb48edf Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 16:48:09 +0200 Subject: [PATCH 1/7] fix login header for ie --- core/css/styles.css | 6 +++--- core/templates/login.php | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/css/styles.css b/core/css/styles.css index 6fc24d4c212..99090b9171e 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -31,7 +31,7 @@ div.controls { width:100%; margin:0px; background-color:#f7f7f7; border-bottom:1 #body-login p.info { width:16em; margin:2em auto; padding:1em; background-color:#eee; border:1px solid #ccc; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; } #body-login p.info a { font-weight:bold; } -#login header { margin-top:-2em; height:10em; +#login div.header { margin-top:-2em; height:10em; -moz-box-shadow:0 0 5px #000; -webkit-box-shadow:0 0 20px #000; box-shadow:0 0 20px #000; background: #1d2d44; /* Old browsers */ background: -moz-linear-gradient(top, #35537a 0%, #1d2d42 100%); /* FF3.6+ */ @@ -39,8 +39,8 @@ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#35537 background: -webkit-linear-gradient(top, #35537a 0%,#1d2d42 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #35537a 0%,#1d2d42 100%); /* Opera11.10+ */ background: -ms-linear-gradient(top, #35537a 0%,#1d2d42 100%); /* IE10+ */ -filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#35537a', endColorstr='#1d2d42',GradientType=0 ); /* IE6-9 */ -background: linear-gradient(top, #35537a 0%,#1d2d42 100%); /* W3C */ } +background: linear-gradient(top, #35537a 0%,#1d2d42 100%); /* W3C */ +filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#35537a', endColorstr='#1d2d42',GradientType=0 ); /* IE6-9 */ } #login { margin:0 auto 0 auto; padding:2em 0 0 0; border-bottom:1px solid #FFF; text-align:center; background:#eee; } #login_form { width:20em; margin:4em auto; padding:0; } #login_form fieldset { background-color:transparent; border:0; } diff --git a/core/templates/login.php b/core/templates/login.php index fb3177eb0ee..c3095047f48 100644 --- a/core/templates/login.php +++ b/core/templates/login.php @@ -1,5 +1,9 @@
-
ownCloud
+
+
+ ownCloud +
+
From 2781fdeed8f1d45ebba23fb2b2e22aa3bbd5f2ff Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 16:52:09 +0200 Subject: [PATCH 2/7] automatically replace svg images with png for browsers that dont support svg --- core/js/js.js | 10 ++++++++++ core/templates/layout.admin.php | 4 ++-- core/templates/layout.user.php | 4 ++-- files/templates/index.php | 4 ++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/core/js/js.js b/core/js/js.js index 407c5708701..db96a1adb3e 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -103,3 +103,13 @@ if (!Array.prototype.indexOf){ function SVGSupport() { return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") || document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Shape", "1.0"); } + +$(document).ready(function(){ + if(!SVGSupport()){//replace all svg images with png images for browser that dont support svg + $('img.svg').each(function(index,element){ + element=$(element); + var src=element.attr('src'); + element.attr('src',src.substr(0,src.length-3)+'png'); + }); + }; +}); diff --git a/core/templates/layout.admin.php b/core/templates/layout.admin.php index 78ccf877221..8077fd304f3 100644 --- a/core/templates/layout.admin.php +++ b/core/templates/layout.admin.php @@ -30,8 +30,8 @@ diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index f8beb79e81e..a100eed96b1 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -31,8 +31,8 @@ ownCloud
    -
  • -
  • +
  • +
diff --git a/files/templates/index.php b/files/templates/index.php index 9bc939ee90a..df78cf0bb2d 100644 --- a/files/templates/index.php +++ b/files/templates/index.php @@ -28,12 +28,12 @@ t( 'Name' ); ?> - Download + Download t( 'Size MB' ); ?> - t( 'Modified' ); ?>Delete + t( 'Modified' ); ?>Delete From 98e78c0599a641ed33ed2abd70e540ce43a7ef15 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 17:51:17 +0200 Subject: [PATCH 3/7] some tweaks for renaming --- files/js/filelist.js | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/files/js/filelist.js b/files/js/filelist.js index 260ca00b977..c3a2522fb6a 100644 --- a/files/js/filelist.js +++ b/files/js/filelist.js @@ -114,10 +114,10 @@ FileList={ td.children('a.name').append(form) input.focus(); form.submit(function(event){ - var newname=input.val(); - tr.data('renaming',false); event.stopPropagation(); event.preventDefault(); + var newname=input.val(); + tr.data('renaming',false); tr.attr('data-file',newname); td.children('a.name').empty(); if(newname.indexOf('.')>0){ @@ -125,9 +125,11 @@ FileList={ }else{ basename=newname; } - td.children('a.name').text(basename); + var span=$(''); + span.text(basename); + td.children('a.name').append(span); if(newname.indexOf('.')>0){ - td.children('a.name').append($(''+newname.substr(newname.indexOf('.'))+'')); + span.append($(''+newname.substr(newname.indexOf('.'))+'')); } $.ajax({ url: 'ajax/rename.php', @@ -139,17 +141,7 @@ FileList={ event.preventDefault(); }); input.blur(function(){ - tr.data('renaming',false); - td.children('a.name').empty(); - if(name.indexOf('.')>0){ - basename=name.substr(0,name.indexOf('.')); - }else{ - basename=name; - } - td.children('a.name').text(basename); - if(name.indexOf('.')>0){ - td.children('a.name').append($(''+name.substr(name.indexOf('.'))+'')); - } + form.trigger('submit'); }); } } From b6ad416757a78f404d757551ffa1697988bbf5b4 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 18:00:42 +0200 Subject: [PATCH 4/7] you can now move files to the root folder by draging them to the Files entry in the navigation panel --- files/js/files.js | 1 + 1 file changed, 1 insertion(+) diff --git a/files/js/files.js b/files/js/files.js index 4e1de1b04a4..be7e48aeeeb 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -5,6 +5,7 @@ $(document).ready(function() { $('#fileList tr td.filename').draggable(dragOptions); $('#fileList tr[data-type="dir"] td.filename').droppable(folderDropOptions); $('div.crumb').droppable(crumbDropOptions); + $('#plugins>ul>li:first-child').data('dir',''); $('#plugins>ul>li:first-child').droppable(crumbDropOptions); // Sets the file-action buttons behaviour : From 9f867abe75d6e8bfc6b30a8ddbf5ca2644598601 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Fri, 29 Jul 2011 12:17:46 -0400 Subject: [PATCH 5/7] Display subnavigation entries in user layout template --- core/templates/layout.user.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index f8beb79e81e..4077499a998 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -44,6 +44,11 @@ From fe47d51598504dacdfce9b84016f8c1fd1af1755 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 19:12:55 +0200 Subject: [PATCH 6/7] some refactoring for subnavigation code --- core/templates/layout.user.php | 5 +++++ lib/app.php | 20 ++++++-------------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index a100eed96b1..f8007548fe2 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -44,6 +44,11 @@ diff --git a/lib/app.php b/lib/app.php index 475015f6779..bccd0c665fa 100644 --- a/lib/app.php +++ b/lib/app.php @@ -310,20 +310,12 @@ class OC_APP{ /// Private foo private static function addSubNavigation( $list ){ - $found = false; - foreach( self::$subnavigation as $parent => $selection ){ - foreach( $selection as $subentry ){ - if( $subentry['id'] == self::$activeapp ){ - foreach( $list as &$naventry ){ - if( $naventry['id'] == $parent ){ - $naventry['active'] = true; - $naventry['subnavigation'] = $selection; - } - else{ - $naventry['active'] = false; - } - } unset( $naventry ); - $found = true; + if(isset(self::$subnavigation[self::$activeapp])){ + $subNav=self::$subnavigation[self::$activeapp]; + foreach( $list as &$naventry ){ + if( $naventry['id'] == self::$activeapp ){ + $naventry['active'] = true; + $naventry['subnavigation'] = $subNav; } } } From d12d08e2f3553b06df6371535f971c9f193bd388 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jul 2011 19:38:01 +0200 Subject: [PATCH 7/7] some more changes for navigation subentries --- core/css/styles.css | 1 + core/templates/layout.admin.php | 11 ++++++---- core/templates/layout.user.php | 15 ++++++++------ lib/app.php | 36 ++++++++++++++++++++++++--------- 4 files changed, 43 insertions(+), 20 deletions(-) diff --git a/core/css/styles.css b/core/css/styles.css index 99090b9171e..00433979d24 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -89,6 +89,7 @@ input[type="search"] { font-size:1em; padding-left:2em; background:#eee url('../ #plugins a:active { outline:0; } #plugins .subentry { background-color:#ddd; border-top:1px solid #aaa; border-bottom:1px solid #ccc; color:#000; outline:0; } #plugins .subentry.active { background-color:#bbb; border-top:1px solid #aaa; border-bottom:1px solid #ccc; color:#000; outline:0; } +#plugins li.subentry a {padding-left:4em;} /* CONTENT ------------------------------------------------------------------ */ #content { margin:3.5em 0 0 15.7em; } diff --git a/core/templates/layout.admin.php b/core/templates/layout.admin.php index 8077fd304f3..3aac4c98ac5 100644 --- a/core/templates/layout.admin.php +++ b/core/templates/layout.admin.php @@ -48,12 +48,15 @@ -
  • class="active">
  • +
  • class="active"> - -
  • - +
      + +
    • + +
    + diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 4440ae28b27..8f073914a1f 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -43,12 +43,15 @@ diff --git a/lib/app.php b/lib/app.php index bccd0c665fa..b6c2512e79a 100644 --- a/lib/app.php +++ b/lib/app.php @@ -158,7 +158,10 @@ class OC_APP{ * the navigation. Lower values come first. */ public static function addNavigationEntry( $data ){ - // TODO: write function + $data['active']=false; + if(!isset($data['icon'])){ + $data['icon']=''; + } OC_APP::$navigation[] = $data; return true; } @@ -184,6 +187,10 @@ class OC_APP{ * the navigation. Lower values come first. */ public static function addNavigationSubEntry( $parent, $data ){ + $data['active']=false; + if(!isset($data['icon'])){ + $data['icon']=''; + } if( !array_key_exists( $parent, self::$subnavigation )){ self::$subnavigation[$parent] = array(); } @@ -318,16 +325,25 @@ class OC_APP{ $naventry['subnavigation'] = $subNav; } } - } - - // Mark subentry as active - foreach( $list as &$naventry ){ - if( $naventry['active'] ){ - foreach( $naventry['subnavigation'] as &$subnaventry ){ - $subnaventry['active'] = $subnaventry['id'] == self::$activeapp? true : false; - } unset( $subnaventry ); + }else{ + foreach(self::$subnavigation as $parent=>$entries){ + $activeParent=false; + foreach($entries as &$subNav){ + $subNav['active']=$subNav['id'] == self::$activeapp; + if($subNav['active']){ + $activeParent=true; + } + } + if($activeParent){ + foreach( $list as &$naventry ){ + if( $naventry['id'] == $parent ){ + $naventry['active'] = true; + $naventry['subnavigation'] = $entries; + } + } + } } - } unset( $naventry ); + } return $list; }