From 3eea7aac1391184e00a92c8801c9f0b54c43bb8d Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 26 Oct 2012 23:38:36 +0200 Subject: first base on navigation rework, less obtrusive, icons need to be updated, settings moved --- apps/files/css/files.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps/files/css/files.css') diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 0b886fc3fa9..1e25ccd36d1 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -82,8 +82,8 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } .selectedActions a img { position:relative; top:.3em; } /* add breadcrumb divider to the File item in navigation panel */ -#navigation>ul>li:first-child { background:url('%webroot%/core/img/breadcrumb-start.svg') no-repeat 12.5em 0px; width:12.5em; padding-right:1em; position:fixed; } -#navigation>ul>li:first-child+li { padding-top:2.9em; } +#navigation>ul>li:first-child { background:url('%webroot%/core/img/breadcrumb-start.svg') no-repeat 65px 0; width:65px; padding-right:1em; position:fixed; } +#navigation>ul>li:first-child+li { padding-top:68px; } #scanning-message{ top:40%; left:40%; position:absolute; display:none; } -- cgit v1.2.3 From b595ea6efc85709640280593459956f786d32b57 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Sat, 27 Oct 2012 17:44:24 +0200 Subject: first icon update. Next step: make sprited hover state (like for home already) --- apps/files/css/files.css | 2 +- core/css/styles.css | 8 +- core/img/places/home.png | Bin 372 -> 884 bytes core/img/places/home.svg | 1781 ++-------------------------------------- core/img/places/music.png | Bin 532 -> 802 bytes core/img/places/music.svg | 1676 ++----------------------------------- core/img/places/picture.png | Bin 300 -> 323 bytes core/img/places/picture.svg | 1696 +------------------------------------- core/templates/layout.user.php | 2 +- 9 files changed, 142 insertions(+), 5023 deletions(-) (limited to 'apps/files/css/files.css') diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 1e25ccd36d1..48051a9a921 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -82,7 +82,7 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } .selectedActions a img { position:relative; top:.3em; } /* add breadcrumb divider to the File item in navigation panel */ -#navigation>ul>li:first-child { background:url('%webroot%/core/img/breadcrumb-start.svg') no-repeat 65px 0; width:65px; padding-right:1em; position:fixed; } +#navigation>ul>li:first-child { background:url('%webroot%/core/img/breadcrumb-start.svg') no-repeat 64px 0; width:64px; padding-right:1em; position:fixed; } #navigation>ul>li:first-child+li { padding-top:68px; } #scanning-message{ top:40%; left:40%; position:absolute; display:none; } diff --git a/core/css/styles.css b/core/css/styles.css index b29133bf79f..5d9464287cb 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -58,7 +58,7 @@ input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text- /* CONTENT ------------------------------------------------------------------ */ #controls { padding: 0 0.5em; width:100%; top:3.5em; height:2.8em; margin:0; background:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:50; -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; } #controls .button { display:inline-block; } -#content { top: 3.5em; left: 65px; position: absolute; } +#content { top:3.5em; left:64px; position: absolute; } #leftcontent, .leftcontent { position:fixed; overflow: auto; top:6.4em; width:20em; background:#f8f8f8; border-right:1px solid #ddd; } #leftcontent li, .leftcontent li { background:#f8f8f8; padding:.5em .8em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; -webkit-transition:background-color 200ms; -moz-transition:background-color 200ms; -o-transition:background-color 200ms; transition:background-color 200ms; } #leftcontent li:hover, #leftcontent li:active, #leftcontent li.active, .leftcontent li:hover, .leftcontent li:active, .leftcontent li.active { background:#eee; } @@ -95,8 +95,10 @@ label.infield { cursor: text !important; } /* NAVIGATION ------------------------------------------------------------- */ -#navigation { position:fixed; top:3.5em; float:left; width:65px; padding:0; z-index:75; height:100%; background:#30343a url('../img/noise.png') repeat; border-right: 1px #ccc solid; -moz-box-shadow: -3px 0 7px #000; -webkit-box-shadow: -3px 0 7px #000; box-shadow: -3px 0 7px #000; overflow:hidden;} -#navigation a { display:block; padding:4px; background:transparent; text-decoration:none; font-size:10px; text-align:center; color:#000; text-shadow:#444 0 1px 0; } +#navigation { position:fixed; top:3.5em; float:left; width:64px; padding:0; z-index:75; height:100%; background:#30343a url('../img/noise.png') repeat; border-right:1px #333 solid; -moz-box-shadow:0 0 7px #000; -webkit-box-shadow:0 0 7px #000; box-shadow:0 0 7px #000; overflow:hidden;} +#navigation a { display:block; padding:8px 0 4px; text-decoration:none; font-size:10px; text-align:center; color:#000; text-shadow:#444 0 1px 0; } +#navigation .icon { width:32px; height:32px; background-position:0 0; background-repeat:no-repeat; margin:0 16px 0; } +/*#navigation li:hover div { background-position:-32px 0; } hover & active effect, activate when icons are sprited*/ #navigation li:first-child { padding-top:8px; } #navigation a img { display:block; width:32px; height:32px; margin:0 auto; } #navigation a.active, #navigation a:hover, #navigation a:focus { color:#888; text-shadow:#000 0 -1px 0; } diff --git a/core/img/places/home.png b/core/img/places/home.png index c3dbd3e3538..a18264d3cea 100644 Binary files a/core/img/places/home.png and b/core/img/places/home.png differ diff --git a/core/img/places/home.svg b/core/img/places/home.svg index 8224d9750ed..e2db10ed36c 100644 --- a/core/img/places/home.svg +++ b/core/img/places/home.svg @@ -7,20 +7,43 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - version="1.0" - width="16" - height="16" - id="svg11300" + width="64" + height="32" + id="svg3349" + version="1.1" inkscape:version="0.48.3.1 r9886" sodipodi:docname="home.svg" - inkscape:export-filename="/home/jancborchardt/jancborchardt/ownCloud/icons/help.png" + inkscape:export-filename="home.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90"> + + + id="metadata3354"> @@ -31,1734 +54,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(573.14286,110.2963)"> + inkscape:connector-curvature="0" + d="m -557.14286,-107.23533 -16,15.93883 6,0 0,12.0002 20,0 0,-12.0002 6,0 -6,-6.061184 0,-7.939046 -6,0 0,2.16233 -4,-4.10093 z" + id="path3307" + style="opacity:0.1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> + + diff --git a/core/img/places/music.png b/core/img/places/music.png index 85ee2474cd1..71a6ac0755f 100644 Binary files a/core/img/places/music.png and b/core/img/places/music.png differ diff --git a/core/img/places/music.svg b/core/img/places/music.svg index 0a810c8887c..f0217415fd1 100644 --- a/core/img/places/music.svg +++ b/core/img/places/music.svg @@ -7,20 +7,43 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - version="1.0" - width="16" - height="16" - id="svg11300" + width="32" + height="32" + id="svg4375" + version="1.1" inkscape:version="0.48.3.1 r9886" - sodipodi:docname="music.svg" - inkscape:export-filename="/home/jancborchardt/jancborchardt/ownCloud/icons/search.png" + sodipodi:docname="picture.svg" + inkscape:export-filename="music.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90"> + + + id="metadata4380"> @@ -31,1627 +54,20 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(581.71429,-2.0764682)"> + + + diff --git a/core/img/places/picture.png b/core/img/places/picture.png index 9abcd09722c..a478876d6a7 100644 Binary files a/core/img/places/picture.png and b/core/img/places/picture.png differ diff --git a/core/img/places/picture.svg b/core/img/places/picture.svg index 8d7848bb979..e48a5568a33 100644 --- a/core/img/places/picture.svg +++ b/core/img/places/picture.svg @@ -7,1685 +7,67 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - version="1.0" - width="16" - height="16" - id="svg11300" + width="32" + height="32" + id="svg4375" + version="1.1" inkscape:version="0.48.3.1 r9886" sodipodi:docname="picture.svg" - inkscape:export-filename="/home/jancborchardt/jancborchardt/ownCloud/icons/audio.png" + inkscape:export-filename="picture.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90"> + + + id="metadata4380"> image/svg+xml - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(581.71429,-2.0764682)"> + d="m -575.01366,5.0805703 c -0.39495,0.0765 -0.70712,0.466654 -0.70001,0.874878 l -6.2e-4,26.2461417 c 10e-6,0.458082 0.41045,0.874866 0.86155,0.874878 l 20.28048,0 c 0.4511,-1.2e-5 0.86154,-0.416796 0.86155,-0.874878 l 6.1e-4,-25.9212227 c -6.5e-4,-0.672871 -0.53099,-1.203711 -1.03374,-1.199797 0,0 -15.52067,0 -20.26982,0 z m 1.29978,19.9958977 18,0 8.2e-4,6 -18.00082,0 z" + style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;opacity:0.1;color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99992162;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" /> diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 2509026dfac..1efce3c7c83 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -46,7 +46,7 @@
  • class="active"> - +
  • -- cgit v1.2.3 From 7af8c6c3cbf00444b81a6d3d0c4cede983ff8edc Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Sun, 28 Oct 2012 16:05:31 +0100 Subject: first version of breadcrumb 'root', still have a weird feeling about this --- apps/files/appinfo/app.php | 2 +- apps/files/css/files.css | 4 - apps/files/templates/part.breadcrumb.php | 11 +- core/css/styles.css | 5 +- core/img/places/files.png | Bin 0 -> 372 bytes core/img/places/files.svg | 1779 ++++++++++++++++++++++++++++++ core/img/places/home.png | Bin 372 -> 364 bytes core/img/places/home.svg | 83 +- 8 files changed, 1853 insertions(+), 31 deletions(-) create mode 100644 core/img/places/files.png create mode 100644 core/img/places/files.svg (limited to 'apps/files/css/files.css') diff --git a/apps/files/appinfo/app.php b/apps/files/appinfo/app.php index b431ddfec02..3f437679e05 100644 --- a/apps/files/appinfo/app.php +++ b/apps/files/appinfo/app.php @@ -3,6 +3,6 @@ $l=OC_L10N::get('files'); OCP\App::registerAdmin('files', 'admin'); -OCP\App::addNavigationEntry( array( "id" => "files_index", "order" => 0, "href" => OCP\Util::linkTo( "files", "index.php" ), "icon" => OCP\Util::imagePath( "core", "places/home.svg" ), "name" => $l->t("Files") )); +OCP\App::addNavigationEntry( array( "id" => "files_index", "order" => 0, "href" => OCP\Util::linkTo( "files", "index.php" ), "icon" => OCP\Util::imagePath( "core", "places/files.svg" ), "name" => $l->t("Files") )); OC_Search::registerProvider('OC_Search_Provider_File'); diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 0b886fc3fa9..64e49d687d3 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -81,10 +81,6 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } .selectedActions a { display:inline; margin:-.5em 0; padding:.5em !important; } .selectedActions a img { position:relative; top:.3em; } -/* add breadcrumb divider to the File item in navigation panel */ -#navigation>ul>li:first-child { background:url('%webroot%/core/img/breadcrumb-start.svg') no-repeat 12.5em 0px; width:12.5em; padding-right:1em; position:fixed; } -#navigation>ul>li:first-child+li { padding-top:2.9em; } #scanning-message{ top:40%; left:40%; position:absolute; display:none; } -div.crumb a{ padding: 0.9em 0 0.7em 0; } diff --git a/apps/files/templates/part.breadcrumb.php b/apps/files/templates/part.breadcrumb.php index 71b695f65f8..37b6b63eabd 100644 --- a/apps/files/templates/part.breadcrumb.php +++ b/apps/files/templates/part.breadcrumb.php @@ -1,6 +1,13 @@ + +
    + + + +
    + -
    svg" data-dir='' style='background-image:url("")'> - "> +
    svg" data-dir=''> +
    diff --git a/core/css/styles.css b/core/css/styles.css index 95dceb50dec..0dbba19742c 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -177,6 +177,7 @@ a.bookmarklet { background-color: #ddd; border:1px solid #ccc; padding: 5px;padd .arrow.down { -webkit-transform: rotate(180deg); -moz-transform: rotate(180deg); -o-transform: rotate(180deg); -ms-transform: rotate(180deg); transform: rotate(180deg); } /* ---- BREADCRUMB ---- */ -div.crumb { float:left; display:block; background:no-repeat right 0; padding:.75em 1.5em 0 1em; height:2.9em; } +div.crumb { float:left; display:block; background:url('../img/breadcrumb.svg') no-repeat right 0; padding:.75em 1.5em 0 1em; height:2.9em; } div.crumb:first-child { padding-left:1em; } -div.crumb.last { font-weight:bold; } +div.crumb.last { font-weight:bold; background:none; padding-right:0; } +div.crumb a{ padding: 0.9em 0 0.7em 0; } diff --git a/core/img/places/files.png b/core/img/places/files.png new file mode 100644 index 00000000000..c3dbd3e3538 Binary files /dev/null and b/core/img/places/files.png differ diff --git a/core/img/places/files.svg b/core/img/places/files.svg new file mode 100644 index 00000000000..4b45ef12bcb --- /dev/null +++ b/core/img/places/files.svg @@ -0,0 +1,1779 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/places/home.png b/core/img/places/home.png index c3dbd3e3538..5cbf1114cb7 100644 Binary files a/core/img/places/home.png and b/core/img/places/home.png differ diff --git a/core/img/places/home.svg b/core/img/places/home.svg index 4b45ef12bcb..c56f9661282 100644 --- a/core/img/places/home.svg +++ b/core/img/places/home.svg @@ -14,9 +14,9 @@ width="16" height="16" id="svg11300" - inkscape:version="0.48.1 r9760" - sodipodi:docname="help.svg" - inkscape:export-filename="/home/jancborchardt/jancborchardt/ownCloud/icons/help.png" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="home.svg" + inkscape:export-filename="home.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90"> + + + + + + + - - - - + + -- cgit v1.2.3 From 94068e5d08cba776e410d925e26037d442b5bc62 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 3 Jan 2013 00:26:13 +0100 Subject: Cache: show upgrade progress --- apps/files/ajax/upgrade.php | 42 +++++++++++ apps/files/appinfo/app.php | 10 --- apps/files/css/files.css | 9 +++ apps/files/index.php | 72 ++++++++++-------- apps/files/js/upgrade.js | 17 +++++ apps/files/templates/upgrade.php | 4 + lib/files/cache/legacy.php | 73 ++++++++++++++++++ lib/files/cache/upgrade.php | 155 ++++++++++++++++++++++++++++----------- 8 files changed, 302 insertions(+), 80 deletions(-) create mode 100644 apps/files/ajax/upgrade.php create mode 100644 apps/files/js/upgrade.js create mode 100644 apps/files/templates/upgrade.php create mode 100644 lib/files/cache/legacy.php (limited to 'apps/files/css/files.css') diff --git a/apps/files/ajax/upgrade.php b/apps/files/ajax/upgrade.php new file mode 100644 index 00000000000..965c0073b8a --- /dev/null +++ b/apps/files/ajax/upgrade.php @@ -0,0 +1,42 @@ +hasItems()) { + OC_Hook::connect('\OC\Files\Cache\Upgrade', 'migrate_path', $listener, 'upgradePath'); + + $upgrade = new \OC\Files\Cache\Upgrade($legacy); + $count = $legacy->getCount(); + $eventSource->send('total', $count); + $upgrade->upgradePath('/' . $user . '/files'); +} +\OC\Files\Cache\Upgrade::upgradeDone($user); +$eventSource->send('done', true); +$eventSource->close(); + +class UpgradeListener { + /** + * @var OC_EventSource $eventSource + */ + private $eventSource; + + private $count = 0; + private $lastSend = 0; + + public function __construct($eventSource) { + $this->eventSource = $eventSource; + } + + public function upgradePath($path) { + $this->count++; + if ($this->count > ($this->lastSend + 5)) { + $this->lastSend = $this->count; + $this->eventSource->send('count', $this->count); + } + } +} diff --git a/apps/files/appinfo/app.php b/apps/files/appinfo/app.php index 643d8ed18a2..ab2f3b01a29 100644 --- a/apps/files/appinfo/app.php +++ b/apps/files/appinfo/app.php @@ -10,13 +10,3 @@ OCP\App::addNavigationEntry( array( "id" => "files_index", "name" => $l->t("Files") )); OC_Search::registerProvider('OC_Search_Provider_File'); - -if (OC_User::isLoggedIn()) { - // update OC4.5 filecache to OC5 filecache, can't do this in update.php since it needs to happen for each user individually - $cacheVersion = (int)OCP\Config::getUserValue(OC_User::getUser(), 'files', 'cache_version', 4); - if ($cacheVersion < 5) { - \OC_Log::write('files', 'updating filecache to 5.0 for user ' . OC_User::getUser(), \OC_Log::INFO); - \OC\Files\Cache\Upgrade::upgrade(); - OCP\Config::setUserValue(OC_User::getUser(), 'files', 'cache_version', 5); - } -} diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 36a1e5c954b..0c130efe472 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -122,3 +122,12 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } #scanning-message{ top:40%; left:40%; position:absolute; display:none; } div.crumb a{ padding:0.9em 0 0.7em 0; } + +#upgrade { + width: 400px; + position: absolute; + top: 200px; + left: 50%; + text-align: center; + margin-left: -200px; +} diff --git a/apps/files/index.php b/apps/files/index.php index 993d8b4dcff..0dce7686962 100644 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -28,7 +28,6 @@ OCP\User::checkLoggedIn(); OCP\Util::addStyle('files', 'files'); OCP\Util::addscript('files', 'jquery.iframe-transport'); OCP\Util::addscript('files', 'jquery.fileupload'); -OCP\Util::addscript('files', 'files'); OCP\Util::addscript('files', 'filelist'); OCP\Util::addscript('files', 'fileactions'); OCP\Util::addscript('files', 'keyboardshortcuts'); @@ -37,8 +36,8 @@ OCP\App::setActiveNavigationEntry('files_index'); // Load the files $dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : ''; // Redirect if directory does not exist -if(!\OC\Files\Filesystem::is_dir($dir . '/')) { - header('Location: '.$_SERVER['SCRIPT_NAME'].''); +if (!\OC\Files\Filesystem::is_dir($dir . '/')) { + header('Location: ' . $_SERVER['SCRIPT_NAME'] . ''); exit(); } @@ -53,16 +52,25 @@ function fileCmp($a, $b) { } $files = array(); -foreach( \OC\Files\Filesystem::getDirectoryContent( $dir ) as $i ) { - $i['date'] = OCP\Util::formatDate($i['mtime'] ); - if($i['type'] == 'file') { +$user = OC_User::getUser(); +if (\OC\Files\Cache\Upgrade::needUpgrade($user)) { //dont load anything if we need to upgrade the cache + $content = array(); + $needUpgrade = true; + $freeSpace = 0; +} else { + $content = \OC\Files\Filesystem::getDirectoryContent($dir); + $freeSpace = \OC\Files\Filesystem::free_space($dir); + $needUpgrade = false; +} +foreach ($content as $i) { + $i['date'] = OCP\Util::formatDate($i['mtime']); + if ($i['type'] == 'file') { $fileinfo = pathinfo($i['name']); $i['basename'] = $fileinfo['filename']; if (!empty($fileinfo['extension'])) { - $i['extension']='.' . $fileinfo['extension']; - } - else { - $i['extension']=''; + $i['extension'] = '.' . $fileinfo['extension']; + } else { + $i['extension'] = ''; } } $i['directory'] = $dir; @@ -74,10 +82,10 @@ usort($files, "fileCmp"); // Make breadcrumb $breadcrumb = array(); $pathtohere = ''; -foreach( explode( '/', $dir ) as $i ) { - if( $i != '' ) { +foreach (explode('/', $dir) as $i) { + if ($i != '') { $pathtohere .= '/' . $i; - $breadcrumb[] = array( 'dir' => $pathtohere, 'name' => $i ); + $breadcrumb[] = array('dir' => $pathtohere, 'name' => $i); } } @@ -94,29 +102,35 @@ $upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize') $post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size')); $maxUploadFilesize = min($upload_max_filesize, $post_max_size); -$freeSpace = \OC\Files\Filesystem::free_space($dir); -$freeSpace = max($freeSpace,0); +$freeSpace = max($freeSpace, 0); $maxUploadFilesize = min($maxUploadFilesize, $freeSpace); $permissions = OCP\PERMISSION_READ; if (\OC\Files\Filesystem::isUpdatable($dir . '/')) { - $permissions |= OCP\PERMISSION_UPDATE; + $permissions |= OCP\PERMISSION_UPDATE; } if (\OC\Files\Filesystem::isDeletable($dir . '/')) { - $permissions |= OCP\PERMISSION_DELETE; + $permissions |= OCP\PERMISSION_DELETE; } if (\OC\Files\Filesystem::isSharable($dir . '/')) { - $permissions |= OCP\PERMISSION_SHARE; + $permissions |= OCP\PERMISSION_SHARE; } -$tmpl = new OCP\Template( 'files', 'index', 'user' ); -$tmpl->assign( 'fileList', $list->fetchPage(), false ); -$tmpl->assign( 'breadcrumb', $breadcrumbNav->fetchPage(), false ); -$tmpl->assign( 'dir', \OC\Files\Filesystem::normalizePath($dir)); -$tmpl->assign( 'isCreatable', \OC\Files\Filesystem::isCreatable($dir . '/')); -$tmpl->assign('permissions', $permissions); -$tmpl->assign('files', $files); -$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize); -$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize)); -$tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); -$tmpl->printPage(); +if ($needUpgrade) { + OCP\Util::addscript('files', 'upgrade'); + $tmpl = new OCP\Template('files', 'upgrade', 'user'); + $tmpl->printPage(); +} else { + OCP\Util::addscript('files', 'files'); + $tmpl = new OCP\Template('files', 'index', 'user'); + $tmpl->assign('fileList', $list->fetchPage(), false); + $tmpl->assign('breadcrumb', $breadcrumbNav->fetchPage(), false); + $tmpl->assign('dir', \OC\Files\Filesystem::normalizePath($dir)); + $tmpl->assign('isCreatable', \OC\Files\Filesystem::isCreatable($dir . '/')); + $tmpl->assign('permissions', $permissions); + $tmpl->assign('files', $files); + $tmpl->assign('uploadMaxFilesize', $maxUploadFilesize); + $tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize)); + $tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); + $tmpl->printPage(); +} diff --git a/apps/files/js/upgrade.js b/apps/files/js/upgrade.js new file mode 100644 index 00000000000..02d57fc9e6c --- /dev/null +++ b/apps/files/js/upgrade.js @@ -0,0 +1,17 @@ +$(document).ready(function () { + var eventSource, total, bar = $('#progressbar'); + console.log('start'); + bar.progressbar({value: 0}); + eventSource = new OC.EventSource(OC.filePath('files', 'ajax', 'upgrade.php')); + eventSource.listen('total', function (count) { + total = count; + console.log(count + ' files needed to be migrated'); + }); + eventSource.listen('count', function (count) { + bar.progressbar({value: (count / total) * 100}); + console.log(count); + }); + eventSource.listen('done', function () { + document.location.reload(); + }); +}); diff --git a/apps/files/templates/upgrade.php b/apps/files/templates/upgrade.php new file mode 100644 index 00000000000..de6cc713028 --- /dev/null +++ b/apps/files/templates/upgrade.php @@ -0,0 +1,4 @@ +
    + t('Upgrading filesystem cache...');?> +
    +
    diff --git a/lib/files/cache/legacy.php b/lib/files/cache/legacy.php new file mode 100644 index 00000000000..ee10a1c1350 --- /dev/null +++ b/lib/files/cache/legacy.php @@ -0,0 +1,73 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Files\Cache; + +/** + * Provide read only support for the old filecache + */ +class Legacy { + private $user; + + public function __construct($user) { + $this->user = $user; + } + + function getCount() { + $query = \OC_DB::prepare('SELECT COUNT(`id`) AS `count` FROM `*PREFIX*fscache` WHERE `user` = ?'); + $result = $query->execute(array($this->user)); + if ($row = $result->fetchRow()) { + return $row['count']; + } else { + return 0; + } + } + + /** + * check if a legacy cache is present and holds items + * + * @return bool + */ + function hasItems() { + try { + $query = \OC_DB::prepare('SELECT `id` FROM `*PREFIX*fscache` WHERE `user` = ? LIMIT 1'); + } catch (\Exception $e) { + return false; + } + try { + $result = $query->execute(array($this->user)); + } catch (\Exception $e) { + return false; + } + return (bool)$result->fetchRow(); + } + + /** + * @param string|int $path + * @return array + */ + function get($path) { + if (is_numeric($path)) { + $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*fscache` WHERE `id` = ?'); + } else { + $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*fscache` WHERE `path` = ?'); + } + $result = $query->execute(array($path)); + return $result->fetchRow(); + } + + /** + * @param int $id + * @return array + */ + function getChildren($id) { + $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*fscache` WHERE `parent` = ?'); + $result = $query->execute(array($id)); + return $result->fetchAll(); + } +} diff --git a/lib/files/cache/upgrade.php b/lib/files/cache/upgrade.php index 77db4c2339e..1032e0a844c 100644 --- a/lib/files/cache/upgrade.php +++ b/lib/files/cache/upgrade.php @@ -9,62 +9,102 @@ namespace OC\Files\Cache; class Upgrade { - static $permissionsCaches = array(); + /** + * @var Legacy $legacy + */ + private $legacy; - static $numericIds = array(); + private $permissionsCaches = array(); - static function upgrade() { - $insertQuery = \OC_DB::prepare('INSERT INTO `*PREFIX*filecache`( `fileid`, `storage`, `path`, `path_hash`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted` ) - VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); + private $numericIds = array(); - try { - $oldEntriesQuery = \OC_DB::prepare('SELECT * FROM `*PREFIX*fscache` ORDER BY `id` ASC'); //sort ascending to ensure the parent gets inserted before a child - } catch (\Exception $e) { - return; - } - try { - $oldEntriesResult = $oldEntriesQuery->execute(); - } catch (\Exception $e) { - return; - } - if (!$oldEntriesResult) { + private $mimeTypeIds = array(); + + /** + * @param Legacy $legacy + */ + public function __construct($legacy) { + $this->legacy = $legacy; + } + + /** + * Preform a shallow upgrade + * + * @param string $path + * @param int $mode + */ + function upgradePath($path, $mode = Scanner::SCAN_RECURSIVE) { + if (!$this->legacy->hasItems()) { return; } + \OC_Hook::emit('\OC\Files\Cache\Upgrade', 'migrate_path', $path); - $checkExistingQuery = \OC_DB::prepare('SELECT `fileid` FROM `*PREFIX*filecache` WHERE `fileid` = ?'); + if ($row = $this->legacy->get($path)) { + $data = $this->getNewData($row); + $this->insert($data); - while ($row = $oldEntriesResult->fetchRow()) { - if ($checkExistingQuery->execute(array($row['id']))->fetchRow()) { - continue; + $children = $this->legacy->getChildren($data['id']); + foreach ($children as $child) { + if ($mode == Scanner::SCAN_SHALLOW) { + $childData = $this->getNewData($child); + \OC_Hook::emit('\OC\Files\Cache\Upgrade', 'migrate_path', $child['path']); + $this->insert($childData); + } else { + $this->upgradePath($child['path']); + } } + } + } - list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($row['path']); - /** - * @var \OC\Files\Storage\Storage $storage - * @var string $internalPath; - */ - $pathHash = md5($internalPath); - $storageId = self::getNumericId($storage); - $parentId = ($internalPath === '') ? -1 : $row['parent']; + /** + * @param array $data the data for the new cache + */ + function insert($data) { + $insertQuery = \OC_DB::prepare('INSERT INTO `*PREFIX*filecache` + ( `fileid`, `storage`, `path`, `path_hash`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted` ) + VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); - $insertQuery->execute(array($row['id'], $storageId, $internalPath, $pathHash, $parentId, $row['name'], $row['mimetype'], $row['mimepart'], $row['size'], $row['mtime'], $row['encrypted'])); + $insertQuery->execute(array($data['id'], $data['storage'], $data['path'], $data['path_hash'], $data['parent'], $data['name'], + $data['mimetype'], $data['mimepart'], $data['size'], $data['mtime'], $data['encrypted'])); - $permissions = ($row['writable']) ? \OCP\PERMISSION_ALL : \OCP\PERMISSION_READ; - $permissionsCache = self::getPermissionsCache($storage); - $permissionsCache->set($row['id'], $row['user'], $permissions); - } + $permissionsCache = $this->getPermissionsCache($data['storage_object']); + $permissionsCache->set($data['id'], $data['user'], $data['permissions']); + } + + /** + * get the new data array from the old one + * + * @param array $data the data from the old cache + * @return array + */ + function getNewData($data) { + $newData = $data; + list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($data['path']); + /** + * @var \OC\Files\Storage\Storage $storage + * @var string $internalPath; + */ + $newData['path_hash'] = md5($internalPath); + $newData['path'] = $internalPath; + $newData['storage'] = $this->getNumericId($storage); + $newData['parent'] = ($internalPath === '') ? -1 : $data['parent']; + $newData['permissions'] = ($data['writable']) ? \OCP\PERMISSION_ALL : \OCP\PERMISSION_READ; + $newData['storage_object'] = $storage; + $newData['mimetype'] = $this->getMimetypeId($newData['mimetype'], $storage); + $newData['mimepart'] = $this->getMimetypeId($newData['mimepart'], $storage); + return $newData; } /** * @param \OC\Files\Storage\Storage $storage * @return Permissions */ - static function getPermissionsCache($storage) { + function getPermissionsCache($storage) { $storageId = $storage->getId(); - if (!isset(self::$permissionsCaches[$storageId])) { - self::$permissionsCaches[$storageId] = $storage->getPermissionsCache(); + if (!isset($this->permissionsCaches[$storageId])) { + $this->permissionsCaches[$storageId] = $storage->getPermissionsCache(); } - return self::$permissionsCaches[$storageId]; + return $this->permissionsCaches[$storageId]; } /** @@ -73,12 +113,45 @@ class Upgrade { * @param \OC\Files\Storage\Storage $storage * @return int */ - static function getNumericId($storage) { + function getNumericId($storage) { $storageId = $storage->getId(); - if (!isset(self::$numericIds[$storageId])) { + if (!isset($this->numericIds[$storageId])) { + $cache = $storage->getCache(); + $this->numericIds[$storageId] = $cache->getNumericStorageId(); + } + return $this->numericIds[$storageId]; + } + + /** + * @param string $mimetype + * @param \OC\Files\Storage\Storage $storage + * @return int + */ + function getMimetypeId($mimetype, $storage) { + if (!isset($this->mimeTypeIds[$mimetype])) { $cache = new Cache($storage); - self::$numericIds[$storageId] = $cache->getNumericStorageId(); + $this->mimeTypeIds[$mimetype] = $cache->getMimetypeId($mimetype); } - return self::$numericIds[$storageId]; + return $this->mimeTypeIds[$mimetype]; + } + + /** + * check if a cache upgrade is required for $user + * + * @param string $user + * @return bool + */ + static function needUpgrade($user) { + $cacheVersion = (int)\OCP\Config::getUserValue($user, 'files', 'cache_version', 4); + return $cacheVersion < 5; + } + + /** + * mark the filecache as upgrade + * + * @param string $user + */ + static function upgradeDone($user) { + \OCP\Config::setUserValue($user, 'files', 'cache_version', 5); } } -- cgit v1.2.3 From 5bfe4adbaa9c402db5bd0d0f74fd9ad7bb037129 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Mon, 14 Jan 2013 20:30:39 +0100 Subject: Whitespace cleanup --- apps/files/css/files.css | 4 ++-- apps/files/js/fileactions.js | 14 +++++------ apps/files/js/files.js | 2 +- apps/files_external/lib/amazons3.php | 2 +- apps/files_external/lib/config.php | 14 +++++------ apps/files_external/templates/settings.php | 4 ++-- apps/files_sharing/js/share.js | 2 +- apps/files_sharing/public.php | 12 +++++----- lib/MDB2/Driver/sqlite3.php | 2 +- lib/api.php | 22 ++++++++--------- lib/app.php | 2 +- lib/backgroundjob.php | 2 +- lib/connector/sabre/node.php | 6 ++--- lib/filecache.php | 4 ++-- lib/fileproxy/quota.php | 2 +- lib/files.php | 2 +- lib/filesystem.php | 14 +++++------ lib/filesystemview.php | 38 +++++++++++++++--------------- lib/helper.php | 2 +- lib/image.php | 2 +- lib/json.php | 2 +- lib/log.php | 4 ++-- lib/ocs/cloud.php | 6 ++--- lib/ocs/config.php | 4 ++-- lib/ocs/person.php | 2 +- lib/ocs/privatedata.php | 4 ++-- lib/ocs/result.php | 14 +++++------ lib/public/constants.php | 1 - lib/public/db.php | 6 ++--- lib/public/share.php | 8 +++---- lib/public/user.php | 2 +- lib/request.php | 4 ++-- lib/setup.php | 2 +- lib/vcategories.php | 1 - 34 files changed, 105 insertions(+), 107 deletions(-) (limited to 'apps/files/css/files.css') diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 36a1e5c954b..0c97b009b88 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -23,7 +23,7 @@ #new>ul>li>p { cursor:pointer; } #new>ul>li>form>input { padding:0.3em; margin:-0.3em; } -#upload { +#upload { height:27px; padding:0; margin-left:0.2em; overflow:hidden; } #upload a { @@ -35,7 +35,7 @@ } .file_upload_target { display:none; } .file_upload_form { display:inline; float:left; margin:0; padding:0; cursor:pointer; overflow:visible; } -#file_upload_start { +#file_upload_start { left:0; top:0; width:28px; height:27px; padding:0; font-size:1em; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter:alpha(opacity=0); opacity:0; diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 80b9c01f838..f5ee363a4c8 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -70,23 +70,23 @@ var FileActions = { } parent.children('a.name').append(''); var defaultAction = FileActions.getDefault(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions()); - + var actionHandler = function (event) { event.stopPropagation(); event.preventDefault(); FileActions.currentFile = event.data.elem; var file = FileActions.getCurrentFile(); - + event.data.actionFunc(file); }; - + $.each(actions, function (name, action) { // NOTE: Temporary fix to prevent rename action in root of Shared directory if (name === 'Rename' && $('#dir').val() === '/Shared') { return true; } - + if ((name === 'Download' || action !== defaultAction) && name !== 'Delete') { var img = FileActions.icons[name]; if (img.call) { @@ -97,16 +97,16 @@ var FileActions = { html += ' '; } html += t('files', name) + ''; - + var element = $(html); element.data('action', name); //alert(element); element.on('click',{a:null, elem:parent, actionFunc:actions[name]},actionHandler); parent.find('a.name>span.fileactions').append(element); } - + }); - + if (actions['Delete']) { var img = FileActions.icons['Delete']; if (img.call) { diff --git a/apps/files/js/files.js b/apps/files/js/files.js index a4260c43285..3a4af6416e9 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -52,7 +52,7 @@ Files={ } }; $(document).ready(function() { - Files.bindKeyboardShortcuts(document, jQuery); + Files.bindKeyboardShortcuts(document, jQuery); $('#fileList tr').each(function(){ //little hack to set unescape filenames in attribute $(this).attr('data-file',decodeURIComponent($(this).attr('data-file'))); diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php index 235ade06db6..e5ef4eb097c 100644 --- a/apps/files_external/lib/amazons3.php +++ b/apps/files_external/lib/amazons3.php @@ -108,7 +108,7 @@ class OC_Filestorage_AmazonS3 extends OC_Filestorage_Common { $stat['atime'] = time(); $stat['mtime'] = $stat['atime']; $stat['ctime'] = $stat['atime']; - } else { + } else { $object = $this->getObject($path); if ($object) { $stat['size'] = $object['Size']; diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 1be544fbc07..fd3dc2ca0d0 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -38,7 +38,7 @@ class OC_Mount_Config { * @return array */ public static function getBackends() { - + $backends['OC_Filestorage_Local']=array( 'backend' => 'Local', 'configuration' => array( @@ -77,7 +77,7 @@ class OC_Mount_Config { 'token' => '#token', 'token_secret' => '#token secret'), 'custom' => 'google'); - + $backends['OC_Filestorage_SWIFT']=array( 'backend' => 'OpenStack Swift', 'configuration' => array( @@ -86,7 +86,7 @@ class OC_Mount_Config { 'token' => '*Token', 'root' => '&Root', 'secure' => '!Secure ftps://')); - + if(OC_Mount_Config::checksmbclient()) $backends['OC_Filestorage_SMB']=array( 'backend' => 'SMB / CIFS', 'configuration' => array( @@ -95,7 +95,7 @@ class OC_Mount_Config { 'password' => '*Password', 'share' => 'Share', 'root' => '&Root')); - + $backends['OC_Filestorage_DAV']=array( 'backend' => 'ownCloud / WebDAV', 'configuration' => array( @@ -103,7 +103,7 @@ class OC_Mount_Config { 'user' => 'Username', 'password' => '*Password', 'root' => '&Root', - 'secure' => '!Secure https://')); + 'secure' => '!Secure https://')); return($backends); } @@ -403,7 +403,7 @@ class OC_Mount_Config { } /** - * check if smbclient is installed + * check if smbclient is installed */ public static function checksmbclient() { if(function_exists('shell_exec')) { @@ -415,7 +415,7 @@ class OC_Mount_Config { } /** - * check if php-ftp is installed + * check if php-ftp is installed */ public static function checkphpftp() { if(function_exists('ftp_login')) { diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index ebfcbfdc42f..78ca1c87fee 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -47,7 +47,7 @@ class="remove" style="visibility:hidden;" - ><?php echo $l->t('Delete'); ?>><?php echo $l->t('Delete'); ?> diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 8a546d62163..a46d0179801 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -1,7 +1,7 @@ $(document).ready(function() { if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined' && !publicListView) { - + FileActions.register('all', 'Share', OC.PERMISSION_READ, OC.imagePath('core', 'actions/share'), function(filename) { if ($('#dir').val() == '/') { var item = $('#dir').val() + filename; diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index 487b9e79961..efd977a1b6a 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -66,12 +66,12 @@ if (isset($_GET['t'])) { $type = $linkItem['item_type']; $fileSource = $linkItem['file_source']; $shareOwner = $linkItem['uid_owner']; - + if (OCP\User::userExists($shareOwner) && $fileSource != -1 ) { - + $pathAndUser = getPathAndUser($linkItem['file_source']); $fileOwner = $pathAndUser['user']; - + //if this is a reshare check the file owner also exists if ($shareOwner != $fileOwner && ! OCP\User::userExists($fileOwner)) { OCP\Util::writeLog('share', 'original file owner '.$fileOwner @@ -81,7 +81,7 @@ if (isset($_GET['t'])) { $tmpl->printPage(); exit(); } - + //mount filesystem of file owner OC_Util::setupFS($fileOwner); } @@ -104,7 +104,7 @@ if (isset($_GET['t'])) { } } $shareOwner = substr($path, 1, strpos($path, '/', 1) - 1); - + if (OCP\User::userExists($shareOwner)) { OC_Util::setupFS($shareOwner); $fileSource = getId($path); @@ -159,7 +159,7 @@ if ($linkItem) { $tmpl->printPage(); exit(); } - + } else { // Check if item id is set in session if (!isset($_SESSION['public_link_authenticated']) diff --git a/lib/MDB2/Driver/sqlite3.php b/lib/MDB2/Driver/sqlite3.php index 9839dafbce1..8f057cfb6e8 100644 --- a/lib/MDB2/Driver/sqlite3.php +++ b/lib/MDB2/Driver/sqlite3.php @@ -98,7 +98,7 @@ class MDB2_Driver_sqlite3 extends MDB2_Driver_Common if ($this->connection) { $native_code = $this->connection->lastErrorCode(); } - $native_msg = html_entity_decode($this->_lasterror); + $native_msg = html_entity_decode($this->_lasterror); // PHP 5.2+ prepends the function name to $php_errormsg, so we need // this hack to work around it, per bug #9599. diff --git a/lib/api.php b/lib/api.php index c464cd04913..8d728d4311f 100644 --- a/lib/api.php +++ b/lib/api.php @@ -42,12 +42,12 @@ class OC_API { private static function init() { self::$server = new OC_OAuth_Server(new OC_OAuth_Store()); } - + /** * api actions */ protected static $actions = array(); - + /** * registers an api call * @param string $method the http method @@ -58,7 +58,7 @@ class OC_API { * @param array $defaults * @param array $requirements */ - public static function register($method, $url, $action, $app, + public static function register($method, $url, $action, $app, $authLevel = OC_API::USER_AUTH, $defaults = array(), $requirements = array()) { @@ -73,7 +73,7 @@ class OC_API { } self::$actions[$name] = array('app' => $app, 'action' => $action, 'authlevel' => $authLevel); } - + /** * handles an api call * @param array $parameters @@ -92,7 +92,7 @@ class OC_API { $response = call_user_func(self::$actions[$name]['action'], $parameters); } else { $response = new OC_OCS_Result(null, 998, 'Api method not found'); - } + } } else { $response = new OC_OCS_Result(null, 997, 'Unauthorised'); } @@ -103,7 +103,7 @@ class OC_API { // logout the user to be stateless OC_User::logout(); } - + /** * authenticate the api call * @param array $action the action details as supplied to OC_API::register() @@ -148,18 +148,18 @@ class OC_API { return false; break; } - } - + } + /** * http basic auth * @return string|false (username, or false on failure) */ - private static function loginUser(){ + private static function loginUser(){ $authUser = isset($_SERVER['PHP_AUTH_USER']) ? $_SERVER['PHP_AUTH_USER'] : ''; $authPw = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; return OC_User::login($authUser, $authPw) ? $authUser : false; } - + /** * respond to a call * @param int|array $result the result from the api method @@ -195,5 +195,5 @@ class OC_API { } } } - + } diff --git a/lib/app.php b/lib/app.php index 3b039733fe5..410cb4c12fc 100644 --- a/lib/app.php +++ b/lib/app.php @@ -137,7 +137,7 @@ class OC_App{ OC_Appconfig::setValue($app, 'types', $appTypes); } - + /** * check if app is shipped * @param string $appid the id of the app to check diff --git a/lib/backgroundjob.php b/lib/backgroundjob.php index 28b5ce3af20..9619dcb732c 100644 --- a/lib/backgroundjob.php +++ b/lib/backgroundjob.php @@ -34,7 +34,7 @@ class OC_BackgroundJob{ public static function getExecutionType() { return OC_Appconfig::getValue( 'core', 'backgroundjobs_mode', 'ajax' ); } - + /** * @brief sets the background jobs execution type * @param $type execution type diff --git a/lib/connector/sabre/node.php b/lib/connector/sabre/node.php index 52350072fb2..026ec9f7ec5 100644 --- a/lib/connector/sabre/node.php +++ b/lib/connector/sabre/node.php @@ -176,9 +176,9 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr * @brief Returns a list of properties for this nodes.; * @param array $properties * @return array - * @note The properties list is a list of propertynames the client - * requested, encoded as xmlnamespace#tagName, for example: - * http://www.example.org/namespace#author If the array is empty, all + * @note The properties list is a list of propertynames the client + * requested, encoded as xmlnamespace#tagName, for example: + * http://www.example.org/namespace#author If the array is empty, all * properties should be returned */ public function getProperties($properties) { diff --git a/lib/filecache.php b/lib/filecache.php index c3256c783e6..bde70757d31 100644 --- a/lib/filecache.php +++ b/lib/filecache.php @@ -59,7 +59,7 @@ class OC_FileCache{ * @param string $path * @param array data * @param string root (optional) - * @note $data is an associative array in the same format as returned + * @note $data is an associative array in the same format as returned * by get */ public static function put($path, $data, $root=false) { @@ -206,7 +206,7 @@ class OC_FileCache{ OC_Cache::remove('fileid/'.$root.$path); } - + /** * return array of filenames matching the querty * @param string $query diff --git a/lib/fileproxy/quota.php b/lib/fileproxy/quota.php index 742e02d471b..503288142aa 100644 --- a/lib/fileproxy/quota.php +++ b/lib/fileproxy/quota.php @@ -76,7 +76,7 @@ class OC_FileProxy_Quota extends OC_FileProxy{ $usedSpace=isset($sharedInfo['size'])?$usedSpace-$sharedInfo['size']:$usedSpace; return $totalSpace-$usedSpace; } - + public function postFree_space($path, $space) { $free=$this->getFreeSpace($path); if($free==-1) { diff --git a/lib/files.php b/lib/files.php index 69097e41074..f4e0f140a44 100644 --- a/lib/files.php +++ b/lib/files.php @@ -141,7 +141,7 @@ class OC_Files { */ public static function get($dir, $files, $only_header = false) { $xsendfile = false; - if (isset($_SERVER['MOD_X_SENDFILE_ENABLED']) || + if (isset($_SERVER['MOD_X_SENDFILE_ENABLED']) || isset($_SERVER['MOD_X_ACCEL_REDIRECT_ENABLED'])) { $xsendfile = true; } diff --git a/lib/filesystem.php b/lib/filesystem.php index aa03593908d..f185d777def 100644 --- a/lib/filesystem.php +++ b/lib/filesystem.php @@ -179,11 +179,11 @@ class OC_Filesystem{ $internalPath=substr($path, strlen($mountPoint)); return $internalPath; } - + static private function mountPointsLoaded($user) { return in_array($user, self::$loadedUsers); } - + /** * get the storage object for a path * @param string path @@ -216,7 +216,7 @@ class OC_Filesystem{ self::mount($options['class'], $options['options'], $mountPoint); } } - + if(isset($mountConfig['group'])) { foreach($mountConfig['group'] as $group=>$mounts) { if(OC_Group::inGroup($user, $group)) { @@ -230,7 +230,7 @@ class OC_Filesystem{ } } } - + if(isset($mountConfig['user'])) { foreach($mountConfig['user'] as $mountUser=>$mounts) { if($user==='all' or strtolower($mountUser)===strtolower($user)) { @@ -244,16 +244,16 @@ class OC_Filesystem{ } } } - + $mtime=filemtime(OC::$SERVERROOT.'/config/mount.php'); $previousMTime=OC_Appconfig::getValue('files', 'mountconfigmtime', 0); if($mtime>$previousMTime) {//mount config has changed, filecache needs to be updated OC_FileCache::triggerUpdate(); OC_Appconfig::setValue('files', 'mountconfigmtime', $mtime); } - } + } } - + static public function init($root, $user = '') { if(self::$defaultInstance) { return false; diff --git a/lib/filesystemview.php b/lib/filesystemview.php index e944ae5045d..ea9cbecee0e 100644 --- a/lib/filesystemview.php +++ b/lib/filesystemview.php @@ -430,10 +430,10 @@ class OC_FilesystemView { $target = $this->fopen($path2.$postFix2, 'w'); $result = OC_Helper::streamCopy($source, $target); } - if( $this->fakeRoot==OC_Filesystem::getRoot() ) { - // If the file to be copied originates within + if( $this->fakeRoot==OC_Filesystem::getRoot() ) { + // If the file to be copied originates within // the user's data directory - + OC_Hook::emit( OC_Filesystem::CLASSNAME, OC_Filesystem::signal_post_copy, @@ -454,33 +454,33 @@ class OC_FilesystemView { OC_Filesystem::signal_post_write, array( OC_Filesystem::signal_param_path => $path2) ); - - } else { - // If this is not a normal file copy operation - // and the file originates somewhere else - // (e.g. a version rollback operation), do not + + } else { + // If this is not a normal file copy operation + // and the file originates somewhere else + // (e.g. a version rollback operation), do not // perform all the other post_write actions - + // Update webdav properties OC_Filesystem::removeETagHook(array("path" => $path2), $this->fakeRoot); - + $splitPath2 = explode( '/', $path2 ); - - // Only cache information about files - // that are being copied from within - // the user files directory. Caching + + // Only cache information about files + // that are being copied from within + // the user files directory. Caching // other files, like VCS backup files, // serves no purpose if ( $splitPath2[1] == 'files' ) { - + OC_FileCache_Update::update($path2, $this->fakeRoot); - + } - + } - + return $result; - + } } } diff --git a/lib/helper.php b/lib/helper.php index 7f34d895821..5d7e3fa4894 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -553,7 +553,7 @@ class OC_Helper { fclose($fh); return $file; } - + /** * create a temporary folder with an unique filename * @return string diff --git a/lib/image.php b/lib/image.php index 2043a452541..cfc6d477395 100644 --- a/lib/image.php +++ b/lib/image.php @@ -646,7 +646,7 @@ class OC_Image { fclose($fh); return $im; } - + /** * @brief Resizes the image preserving ratio. * @param $maxsize The maximum size of either the width or height. diff --git a/lib/json.php b/lib/json.php index c87de3e200b..f929e958957 100644 --- a/lib/json.php +++ b/lib/json.php @@ -74,7 +74,7 @@ class OC_JSON{ exit(); } } - + /** * Send json error msg */ diff --git a/lib/log.php b/lib/log.php index e9cededa5c0..e869282e88c 100644 --- a/lib/log.php +++ b/lib/log.php @@ -39,7 +39,7 @@ class OC_Log { $log_class::write($app, $message, $level); } } - + //Fatal errors handler public static function onShutdown() { $error = error_get_last(); @@ -50,7 +50,7 @@ class OC_Log { return true; } } - + // Uncaught exception handler public static function onException($exception) { self::write('PHP', $exception->getMessage() . ' at ' . $exception->getFile() . '#' . $exception->getLine(), self::FATAL); diff --git a/lib/ocs/cloud.php b/lib/ocs/cloud.php index faafe9a62dd..2d18b1db3f2 100644 --- a/lib/ocs/cloud.php +++ b/lib/ocs/cloud.php @@ -37,7 +37,7 @@ class OC_OCS_Cloud { } return new OC_OCS_Result($values); } - + public static function getUserQuota($parameters) { $user = OC_User::getUser(); if(OC_User::isAdminUser($user) or ($user==$parameters['user'])) { @@ -68,7 +68,7 @@ class OC_OCS_Cloud { return new OC_OCS_Result(null, 300); } } - + public static function getUserPublickey($parameters) { if(OC_User::userExists($parameters['user'])) { @@ -79,7 +79,7 @@ class OC_OCS_Cloud { return new OC_OCS_Result(null, 300); } } - + public static function getUserPrivatekey($parameters) { $user = OC_User::getUser(); if(OC_User::isAdminUser($user) or ($user==$parameters['user'])) { diff --git a/lib/ocs/config.php b/lib/ocs/config.php index 03c54aa2314..f19121f4b2b 100644 --- a/lib/ocs/config.php +++ b/lib/ocs/config.php @@ -23,7 +23,7 @@ */ class OC_OCS_Config { - + public static function apiConfig($parameters) { $xml['version'] = '1.7'; $xml['website'] = 'ownCloud'; @@ -32,5 +32,5 @@ class OC_OCS_Config { $xml['ssl'] = 'false'; return new OC_OCS_Result($xml); } - + } diff --git a/lib/ocs/person.php b/lib/ocs/person.php index 169cc8211db..1c8210d0825 100644 --- a/lib/ocs/person.php +++ b/lib/ocs/person.php @@ -38,5 +38,5 @@ class OC_OCS_Person { return new OC_OCS_Result(null, 101); } } - + } diff --git a/lib/ocs/privatedata.php b/lib/ocs/privatedata.php index e01ed5e8b07..311b24269dd 100644 --- a/lib/ocs/privatedata.php +++ b/lib/ocs/privatedata.php @@ -39,7 +39,7 @@ class OC_OCS_Privatedata { return new OC_OCS_Result($xml); //TODO: replace 'privatedata' with 'attribute' once a new libattice has been released that works with it } - + public static function set($parameters) { OC_Util::checkLoggedIn(); $user = OC_User::getUser(); @@ -50,7 +50,7 @@ class OC_OCS_Privatedata { return new OC_OCS_Result(null, 100); } } - + public static function delete($parameters) { OC_Util::checkLoggedIn(); $user = OC_User::getUser(); diff --git a/lib/ocs/result.php b/lib/ocs/result.php index b08d911f785..65b2067fc3f 100644 --- a/lib/ocs/result.php +++ b/lib/ocs/result.php @@ -21,9 +21,9 @@ */ class OC_OCS_Result{ - + private $data, $message, $statusCode, $items, $perPage; - + /** * create the OCS_Result object * @param $data mixed the data to return @@ -33,7 +33,7 @@ class OC_OCS_Result{ $this->statusCode = $code; $this->message = $message; } - + /** * optionally set the total number of items available * @param $items int @@ -41,7 +41,7 @@ class OC_OCS_Result{ public function setTotalItems(int $items) { $this->items = $items; } - + /** * optionally set the the number of items per page * @param $items int @@ -49,7 +49,7 @@ class OC_OCS_Result{ public function setItemsPerPage(int $items) { $this->perPage = $items; } - + /** * returns the data associated with the api result * @return array @@ -70,6 +70,6 @@ class OC_OCS_Result{ // Return the result data. return $return; } - - + + } \ No newline at end of file diff --git a/lib/public/constants.php b/lib/public/constants.php index bc979c9031f..1495c620dc9 100644 --- a/lib/public/constants.php +++ b/lib/public/constants.php @@ -35,4 +35,3 @@ const PERMISSION_UPDATE = 2; const PERMISSION_DELETE = 8; const PERMISSION_SHARE = 16; const PERMISSION_ALL = 31; - diff --git a/lib/public/db.php b/lib/public/db.php index 5d4aadd22ae..932e79d9ef1 100644 --- a/lib/public/db.php +++ b/lib/public/db.php @@ -49,9 +49,9 @@ class DB { * @brief Insert a row if a matching row doesn't exists. * @param $table string The table name (will replace *PREFIX*) to perform the replace on. * @param $input array - * + * * The input array if in the form: - * + * * array ( 'id' => array ( 'value' => 6, * 'key' => true * ), @@ -65,7 +65,7 @@ class DB { public static function insertIfNotExist($table, $input) { return(\OC_DB::insertIfNotExist($table, $input)); } - + /** * @brief gets last value of autoincrement * @param $table string The optional table name (will replace *PREFIX*) and add sequence suffix diff --git a/lib/public/share.php b/lib/public/share.php index 7ed1c42490d..cda583aa073 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -351,14 +351,14 @@ class Share { //delete the old share self::delete($checkExists['id']); } - + // Generate hash of password - same method as user passwords if (isset($shareWith)) { $forcePortable = (CRYPT_BLOWFISH != 1); $hasher = new \PasswordHash(8, $forcePortable); $shareWith = $hasher->HashPassword($shareWith.\OC_Config::getValue('passwordsalt', '')); } - + // Generate token if (isset($oldToken)) { $token = $oldToken; @@ -415,7 +415,7 @@ class Share { if ($parentFolder && $files = \OC_Files::getDirectoryContent($itemSource)) { for ($i = 0; $i < count($files); $i++) { $name = substr($files[$i]['name'], strpos($files[$i]['name'], $itemSource) - strlen($itemSource)); - if ($files[$i]['mimetype'] == 'httpd/unix-directory' + if ($files[$i]['mimetype'] == 'httpd/unix-directory' && $children = \OC_Files::getDirectoryContent($name, '/') ) { // Continue scanning into child folders @@ -864,7 +864,7 @@ class Share { } } else { if ($fileDependent) { - if (($itemType == 'file' || $itemType == 'folder') + if (($itemType == 'file' || $itemType == 'folder') && $format == \OC_Share_Backend_File::FORMAT_FILE_APP || $format == \OC_Share_Backend_File::FORMAT_FILE_APP_ROOT ) { diff --git a/lib/public/user.php b/lib/public/user.php index e297b716dc2..204d8e4c0f1 100644 --- a/lib/public/user.php +++ b/lib/public/user.php @@ -65,7 +65,7 @@ class User { /** * @brief check if a user exists * @param string $uid the username - * @param string $excludingBackend (default none) + * @param string $excludingBackend (default none) * @return boolean */ public static function userExists( $uid, $excludingBackend = null ) { diff --git a/lib/request.php b/lib/request.php index 99a77e1b59e..f2f15c21103 100755 --- a/lib/request.php +++ b/lib/request.php @@ -19,7 +19,7 @@ class OC_Request { return 'localhost'; } if(OC_Config::getValue('overwritehost', '')<>'') { - return OC_Config::getValue('overwritehost'); + return OC_Config::getValue('overwritehost'); } if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) { if (strpos($_SERVER['HTTP_X_FORWARDED_HOST'], ",") !== false) { @@ -44,7 +44,7 @@ class OC_Request { */ public static function serverProtocol() { if(OC_Config::getValue('overwriteprotocol', '')<>'') { - return OC_Config::getValue('overwriteprotocol'); + return OC_Config::getValue('overwriteprotocol'); } if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) { $proto = strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']); diff --git a/lib/setup.php b/lib/setup.php index fdd10be6824..b88bc4b52ce 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -153,7 +153,7 @@ class OC_Setup { if (isset($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache')) { self::createHtaccess(); } - + //and we are done OC_Config::setValue('installed', true); } diff --git a/lib/vcategories.php b/lib/vcategories.php index 406a4eb1074..1700870f91f 100644 --- a/lib/vcategories.php +++ b/lib/vcategories.php @@ -763,4 +763,3 @@ class OC_VCategories { return array_search(strtolower($needle), array_map('strtolower', $haystack)); } } - -- cgit v1.2.3 From 9d77317de82cb5ea3e3e8e2a3d13122134e0ca0c Mon Sep 17 00:00:00 2001 From: Björn Schießle Date: Tue, 15 Jan 2013 20:35:15 +0100 Subject: add trash button to web interface --- apps/files/css/files.css | 4 +++- apps/files/index.php | 1 + apps/files/js/files.js | 5 +++++ apps/files/templates/index.php | 6 +++++- 4 files changed, 14 insertions(+), 2 deletions(-) (limited to 'apps/files/css/files.css') diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 0c97b009b88..f9406f58652 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -23,7 +23,9 @@ #new>ul>li>p { cursor:pointer; } #new>ul>li>form>input { padding:0.3em; margin:-0.3em; } -#upload { +#trash { height:17px; margin:0 0 0 1em; z-index:1010; position:absolute; right:13.5em; } + +#upload { height:27px; padding:0; margin-left:0.2em; overflow:hidden; } #upload a { diff --git a/apps/files/index.php b/apps/files/index.php index 1c4b7fbd497..8861be72283 100644 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -100,6 +100,7 @@ $tmpl->assign('dir', OC_Filesystem::normalizePath($dir)); $tmpl->assign('isCreatable', OC_Filesystem::isCreatable($dir . '/')); $tmpl->assign('permissions', $permissions); $tmpl->assign('files', $files); +$tmpl->assign('trash', \OCP\App::isEnabled('files_trashbin')); $tmpl->assign('uploadMaxFilesize', $maxUploadFilesize); $tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize)); $tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); diff --git a/apps/files/js/files.js b/apps/files/js/files.js index c1abe205151..9f5169fea58 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -99,6 +99,11 @@ $(document).ready(function() { $(this).parent().children('#file_upload_start').trigger('click'); return false; }); + + // Show Trash bin + $('#trash a').live('click', function() { + console.log("hello"); + }); var lastChecked; diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 2e0772443f2..f6b4c29d5a2 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -35,6 +35,11 @@
    + + +
    -
    -- cgit v1.2.3 From 01b3c088a9d8fb150f841f401d3e5668d228b098 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Mon, 28 Jan 2013 19:47:51 +0100 Subject: fix color change on click --- apps/files/css/files.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/files/css/files.css') diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 0c97b009b88..e65f724f688 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -104,7 +104,7 @@ table td.filename form { font-size:.85em; margin-left:3em; margin-right:3em; } #fileList tr:hover .fileactions { /* background to distinguish when overlaying with file names */ background:rgba(248,248,248,.9); box-shadow:-5px 0 7px rgba(248,248,248,.9); } -#fileList tr.selected:hover .fileactions { /* slightly darker color for selected rows */ +#fileList tr.selected:hover .fileactions, #fileList tr.mouseOver .fileactions { /* slightly darker color for selected rows */ background:rgba(238,238,238,.9); box-shadow:-5px 0 7px rgba(238,238,238,.9); } #fileList .fileactions a.action img { position:relative; top:.2em; } -- cgit v1.2.3 From 0089b17749fa3d8bb0b7eaa7abf493e49b9a7e11 Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Fri, 18 Jan 2013 21:49:38 +0100 Subject: add multselect dnd --- apps/files/css/files.css | 11 ++++ apps/files/js/files.js | 129 +++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 119 insertions(+), 21 deletions(-) (limited to 'apps/files/css/files.css') diff --git a/apps/files/css/files.css b/apps/files/css/files.css index e65f724f688..9ff550189db 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -122,3 +122,14 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } #scanning-message{ top:40%; left:40%; position:absolute; display:none; } div.crumb a{ padding:0.9em 0 0.7em 0; } + +table.dragshadow { + width:auto; +} +table.dragshadow td.filename { + padding-left:36px; + padding-right:16px; +} +table.dragshadow td.size { + padding-right:8px; +} \ No newline at end of file diff --git a/apps/files/js/files.js b/apps/files/js/files.js index c817d8431e2..00887784577 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -813,32 +813,102 @@ function updateBreadcrumb(breadcrumbHtml) { $('p.nav').empty().html(breadcrumbHtml); } -//options for file drag/dropp +var createDragShadow = function(event){ + //select dragged file + $(event.target).parents('tr').find('td input:first').prop('checked', true); + + var selectedFiles = getSelectedFiles(); + + //also update class when we dragged more than one file + if (selectedFiles.length > 1) { + $(event.target).parents('tr').addClass('selected'); + } + + // build dragshadow + var dragshadow = $('
    '); + var tbody = $(''); + dragshadow.append(tbody); + + var dir=$('#dir').val(); + + $(selectedFiles).each(function(i,elem){ + var selected= $(event.target).parents('tr').hasClass('selected'); + var newtr = $('' + +''+elem.name+''+humanFileSize(elem.size)+'' + +''); + tbody.append(newtr); + if (elem.type === 'dir') { + newtr.find('td.filename').attr('style','background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')'); + } else { + getMimeIcon(elem.mime,function(path){ + newtr.find('td.filename').attr('style','background-image:url('+path+')'); + }); + } + }); + + return dragshadow; +} + +//options for file drag/drop var dragOptions={ - distance: 20, revert: 'invalid', opacity: 0.7, helper: 'clone', + revert: 'invalid', opacity: 0.7, zIndex: 100, appendTo: 'body', cursorAt: { left: -5, top: -5 }, + helper: createDragShadow, cursor: 'move', stop: function(event, ui) { $('#fileList tr td.filename').addClass('ui-draggable'); + //reset selection + $(ui.helper.find('tr')).each(function(i,row){ + var file = $(row).data('filename'); + var selected = $(row).data('selected'); + $('#fileList tr').filterAttr('data-file',file).find('td input:first').prop('checked',selected); + }); } -}; +} + var folderDropOptions={ drop: function( event, ui ) { - var file=ui.draggable.parent().data('file'); + //don't allow moving a file into a selected folder + if ($(event.target).parents('tr').find('td input:first').prop('checked') === true) { + return false; + } + var target=$(this).find('.nametext').text().trim(); - var dir=$('#dir').val(); - $.ajax({ - url: OC.filePath('files', 'ajax', 'move.php'), - data: "dir="+encodeURIComponent(dir)+"&file="+encodeURIComponent(file)+'&target='+encodeURIComponent(dir)+'/'+encodeURIComponent(target), - complete: function(data){boolOperationFinished(data, function(){ - var el = $('#fileList tr').filterAttr('data-file',file).find('td.filename'); - el.draggable('destroy'); - FileList.remove(file); - });} + + var files = ui.helper.find('tr'); + $(files).each(function(i,row){ + var dir = $(row).data('dir'); + var file = $(row).data('filename'); + $.get(OC.filePath('files', 'ajax', 'move.php'), { dir: dir, file: file, target: dir+'/'+target }, function(result) { + if (result) { + if (result.status === 'success') { + //recalculate folder size + var oldSize = $('#fileList tr').filterAttr('data-file',target).data('size'); + var newSize = oldSize + $('#fileList tr').filterAttr('data-file',file).data('size'); + $('#fileList tr').filterAttr('data-file',target).data('size', newSize); + $('#fileList tr').filterAttr('data-file',target).find('td.filesize').text(humanFileSize(newSize)); + + FileList.remove(file); + procesSelection(); + $('#notification').hide(); + } else { + $('#notification').hide(); + $('#notification').text(result.data.message); + $('#notification').fadeIn(); + } + } else { + OC.dialogs.alert(t('Error moving file')); + } + }); }); - } + //reset checkbox if we dragged a single file + if (files.length == 1) { + $(event.target).parents('tr').find('td input:first').prop('checked', $(event.target).parents('tr').hasClass('selected')); + } + }, + tolerance: 'pointer' } + var crumbDropOptions={ drop: function( event, ui ) { - var file=ui.draggable.parent().data('file'); var target=$(this).data('dir'); var dir=$('#dir').val(); while(dir.substr(0,1)=='/'){//remove extra leading /'s @@ -851,13 +921,30 @@ var crumbDropOptions={ if(target==dir || target+'/'==dir){ return; } - $.ajax({ - url: OC.filePath('files', 'ajax', 'move.php'), - data: "dir="+encodeURIComponent(dir)+"&file="+encodeURIComponent(file)+'&target='+encodeURIComponent(target), - complete: function(data){boolOperationFinished(data, function(){ - FileList.remove(file); - });} + var files = ui.helper.find('tr'); + $(files).each(function(i,row){ + var dir = $(row).data('dir'); + var file = $(row).data('filename'); + $.get(OC.filePath('files', 'ajax', 'move.php'), { dir: dir, file: file, target: target }, function(result) { + if (result) { + if (result.status === 'success') { + FileList.remove(file); + procesSelection(); + $('#notification').hide(); + } else { + $('#notification').hide(); + $('#notification').text(result.data.message); + $('#notification').fadeIn(); + } + } else { + OC.dialogs.alert(t('Error moving file')); + } + }); }); + //reset checkbox if we dragged a single file + if (files.length == 1) { + $(event.target).parents('tr').find('td input:first').prop('checked', $(event.target).parents('tr').hasClass('selected')); + } }, tolerance: 'pointer' } -- cgit v1.2.3 From 1592764a60263a8ecfe691e25f522514eae5022c Mon Sep 17 00:00:00 2001 From: Björn Schießle Date: Wed, 30 Jan 2013 14:32:20 +0100 Subject: show a spinner instead of the delete button while moving files to the trash bin --- apps/files/css/files.css | 1 + apps/files/js/filelist.js | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'apps/files/css/files.css') diff --git a/apps/files/css/files.css b/apps/files/css/files.css index f9406f58652..f3376458456 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -111,6 +111,7 @@ table td.filename form { font-size:.85em; margin-left:3em; margin-right:3em; } } #fileList .fileactions a.action img { position:relative; top:.2em; } #fileList a.action { display:inline; margin:-.5em 0; padding:1em .5em 1em .5em !important; } +#fileList img.move2trash { display:inline; margin:-.5em 0; padding:1em .5em 1em .5em !important; float:right; } a.action.delete { float:right; } a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } .selectedActions { display:none; float:right; } diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 5cb8849ffea..28230409d2b 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -271,13 +271,20 @@ var FileList={ } }, do_delete:function(files){ + if(files.substr){ + files=[files]; + } + for (var i in files) { + var deleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date").children(".action.delete"); + var oldHTML = deleteAction[0].outerHTML; + var newHTML = ''; + deleteAction[0].outerHTML = newHTML; + } // Finish any existing actions if (FileList.lastAction) { FileList.lastAction(); } - if(files.substr){ - files=[files]; - } + var fileNames = JSON.stringify(files); $.post(OC.filePath('files', 'ajax', 'delete.php'), {dir:$('#dir').val(),files:fileNames}, @@ -290,6 +297,11 @@ var FileList={ files.removeClass('selected'); }); procesSelection(); + } else { + $.each(files,function(index,file) { + var deleteAction = $('tr').filterAttr('data-file',file).children("td.date").children(".move2trash"); + deleteAction[0].outerHTML = oldHTML; + }); } }); } -- cgit v1.2.3 From 1557b6d99dd55bfd6b55eadf78cc954273bdcf54 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Sun, 3 Feb 2013 14:44:33 +0100 Subject: Fix leftcontent positioning. Ref #1255 --- apps/files/css/files.css | 2 +- core/css/styles.css | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'apps/files/css/files.css') diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 661a2e827a4..e18836a7389 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -55,7 +55,7 @@ font-size:1.5em; font-weight:bold; color:#888; text-shadow:#fff 0 1px 0; } -table { position:relative; top:37px; width:100%; } +table { position:relative; width:100%; } tbody tr { background-color:#fff; height:2.5em; } tbody tr:hover, tbody tr:active, tbody tr.selected { background-color:#f8f8f8; } tbody tr.selected { background-color:#eee; } diff --git a/core/css/styles.css b/core/css/styles.css index 19cfad76268..685a20ba081 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -119,7 +119,7 @@ input[type="submit"].enabled { background:#66f866; border:1px solid #5e5; -moz-b #select_all{ margin-top:.4em !important;} /* CONTENT ------------------------------------------------------------------ */ -#controls { padding:0 0.5em; width:100%; top:3.5em; height:2.8em; margin:0; background:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:50; -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; } +#controls { padding:0 0.5em; width:100%; top:0; height:2.8em; margin:0; background:#f7f7f7; border-bottom:1px solid #eee; position:relative; z-index:50; -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; } #controls .button { display:inline-block; } #content { position:relative; height:100%; width:100%; } @@ -128,9 +128,9 @@ input[type="submit"].enabled { background:#66f866; border:1px solid #5e5; -moz-b -moz-box-sizing:border-box; box-sizing:border-box; } #leftcontent, .leftcontent { - position:fixed; overflow:auto; top:0; width:20em; height:100%; + position:relative; overflow:auto; width:20em; height:100%; background:#f8f8f8; border-right:1px solid #ddd; - -moz-box-sizing:border-box; box-sizing:border-box; padding-top:6.4em; + -moz-box-sizing:border-box; box-sizing:border-box; } #leftcontent li, .leftcontent li { background:#f8f8f8; padding:.5em .8em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; -webkit-transition:background-color 200ms; -moz-transition:background-color 200ms; -o-transition:background-color 200ms; transition:background-color 200ms; } #leftcontent li:hover, #leftcontent li:active, #leftcontent li.active, .leftcontent li:hover, .leftcontent li:active, .leftcontent li.active { background:#eee; } -- cgit v1.2.3 From 9060c3bd83f7fa3eeee2f5e303055c84e19f8f5b Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sun, 3 Feb 2013 17:12:57 +0100 Subject: Files: fix positioning of Trash button and upload progress bar --- apps/files/css/files.css | 4 ++-- apps/files/templates/index.php | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'apps/files/css/files.css') diff --git a/apps/files/css/files.css b/apps/files/css/files.css index e18836a7389..0a12439c359 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -23,7 +23,7 @@ #new>ul>li>p { cursor:pointer; } #new>ul>li>form>input { padding:0.3em; margin:-0.3em; } -#trash { height:17px; margin:0 0 0 1em; z-index:1010; position:absolute; right:13.5em; } +#trash { height:17px; margin:0.3em 0.3em 0.3em 1em; z-index:1010; float: right; } #upload { height:27px; padding:0; margin-left:0.2em; overflow:hidden; @@ -44,7 +44,7 @@ z-index:20; position:relative; cursor:pointer; overflow:hidden; } -#uploadprogresswrapper { position:absolute; right:13.5em; top:0em; } +#uploadprogresswrapper { float: right; position: relative; } #uploadprogresswrapper #uploadprogressbar { position:relative; display:inline-block; width:10em; height:1.5em; top:.4em; } /* FILE TABLE */ diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 2d4ed9ab2d9..9c12067ae95 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -35,18 +35,18 @@ - + + - -
    -
    - +
    +
    + -
    -- cgit v1.2.3 From b06ac67e07512fbf1b12e586bc73d7569aec9e24 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Mon, 4 Feb 2013 18:30:49 +0100 Subject: Add 'hascontrols' class for content with fixed topbar. --- apps/files/css/files.css | 4 ++-- apps/files/templates/index.php | 18 +++++++++--------- core/css/styles.css | 10 +++++++++- settings/templates/apps.php | 2 +- settings/templates/users.php | 2 +- 5 files changed, 22 insertions(+), 14 deletions(-) (limited to 'apps/files/css/files.css') diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 0a12439c359..f37ac4c262a 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -3,7 +3,7 @@ See the COPYING-README file. */ /* FILE MENU */ -.actions { padding:.3em; float:left; height:2em; } +.actions { padding:.3em; float:left; height:2em; width: 100%; } .actions input, .actions button, .actions .button { margin:0; float:left; } #new { @@ -23,7 +23,7 @@ #new>ul>li>p { cursor:pointer; } #new>ul>li>form>input { padding:0.3em; margin:-0.3em; } -#trash { height:17px; margin:0.3em 0.3em 0.3em 1em; z-index:1010; float: right; } +#trash { height:17px; margin: 0 1em; z-index:1010; float: right; } #upload { height:27px; padding:0; margin-left:0.2em; overflow:hidden; diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 9c12067ae95..0b4aa21eac3 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -35,18 +35,18 @@ - - + - -
    -
    - +
    +
    + +
    @@ -59,7 +59,7 @@
    t('Nothing in here. Upload something!')?>
    - +
    diff --git a/core/css/styles.css b/core/css/styles.css index 80485fd063d..02300ff4cd3 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -119,10 +119,18 @@ input[type="submit"].enabled { background:#66f866; border:1px solid #5e5; -moz-b #select_all{ margin-top:.4em !important;} /* CONTENT ------------------------------------------------------------------ */ -#controls { padding:0 0.5em; width:100%; top:0; height:2.8em; margin:0; background:#f7f7f7; border-bottom:1px solid #eee; position:relative; -moz-box-sizing:border-box; box-sizing:border-box; z-index:50; -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; } +#controls { + position:fixed; + height:2.8em; width:100%; + padding:0 70px 0 0.5em; margin:0; + -moz-box-sizing:border-box; box-sizing:border-box; + -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; + background:#f7f7f7; border-bottom:1px solid #eee; z-index:50; +} #controls .button { display:inline-block; } #content { position:relative; height:100%; width:100%; } +#content .hascontrols { position: relative; top: 3em; } #content-wrapper { position:absolute; height:100%; width:100%; padding-top:3.5em; padding-left:64px; -moz-box-sizing:border-box; box-sizing:border-box; diff --git a/settings/templates/apps.php b/settings/templates/apps.php index 3f0d2a9d1c6..ed1232ac322 100644 --- a/settings/templates/apps.php +++ b/settings/templates/apps.php @@ -10,7 +10,7 @@ t('Add your App');?> t('More Apps');?> -
      +
      • data-id="" data-type="" data-installed="1"> diff --git a/settings/templates/users.php b/settings/templates/users.php index 4d7c29678ce..b3cab526947 100644 --- a/settings/templates/users.php +++ b/settings/templates/users.php @@ -73,7 +73,7 @@ $_['subadmingroups'] = array_flip($items); - +
        -- cgit v1.2.3 From ddd47978e115381e2fa9f22496994c54383c67f4 Mon Sep 17 00:00:00 2001 From: Myles McNamara Date: Wed, 6 Feb 2013 13:44:41 -0500 Subject: Remove left float from actions div class --- apps/files/css/files.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/files/css/files.css') diff --git a/apps/files/css/files.css b/apps/files/css/files.css index f37ac4c262a..67bd569ceef 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -3,7 +3,7 @@ See the COPYING-README file. */ /* FILE MENU */ -.actions { padding:.3em; float:left; height:2em; width: 100%; } +.actions { padding:.3em; height:2em; width: 100%; } .actions input, .actions button, .actions .button { margin:0; float:left; } #new { -- cgit v1.2.3 From 680af2e6caac9a41ac6fe425632055312ea7c8ea Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Fri, 8 Feb 2013 22:30:27 +0100 Subject: Fix filelist shifting up one row on (multi)select --- apps/files/css/files.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'apps/files/css/files.css') diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 67bd569ceef..2c5842cbf65 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -73,8 +73,7 @@ table th#headerSize, table td.filesize { min-width:3em; padding:0 1em; text-alig table th#headerDate, table td.date { min-width:11em; padding:0 .1em 0 1em; text-align:left; } /* Multiselect bar */ -table.multiselect { top:63px; } -table.multiselect thead { position:fixed; top:82px; z-index:1; } +table.multiselect thead { z-index:1; } table.multiselect thead th { background:rgba(230,230,230,.8); color:#000; font-weight:bold; border-bottom:0; } table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; } -- cgit v1.2.3 From 60344bf1dd48e52baa129c8fc04e81a338c12551 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Sat, 9 Feb 2013 14:00:26 +0100 Subject: Another attempt on the filelist heading. --- apps/files/css/files.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps/files/css/files.css') diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 2c5842cbf65..caebb5151de 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -73,9 +73,9 @@ table th#headerSize, table td.filesize { min-width:3em; padding:0 1em; text-alig table th#headerDate, table td.date { min-width:11em; padding:0 .1em 0 1em; text-align:left; } /* Multiselect bar */ -table.multiselect thead { z-index:1; } +table.multiselect thead { position:fixed; z-index:1; } table.multiselect thead th { background:rgba(230,230,230,.8); color:#000; font-weight:bold; border-bottom:0; } - +table.multiselect tbody { position: absolute; margin-top:2em; } table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; } table td.filename a.name { display:block; height:1.5em; vertical-align:middle; margin-left:3em; } table tr[data-type="dir"] td.filename a.name span.nametext {font-weight:bold; } -- cgit v1.2.3 From 419eced65c0c0d86e6b237af8a5c4a9961aa21f5 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Sat, 9 Feb 2013 17:54:56 +0100 Subject: Remove hascontrols - use original positioning. I couldn't get Chromium and FF to agree, so a working hack is better than a non-working one ;) --- apps/files/css/files.css | 6 +++--- apps/files/templates/index.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'apps/files/css/files.css') diff --git a/apps/files/css/files.css b/apps/files/css/files.css index caebb5151de..620fe8606be 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -55,7 +55,7 @@ font-size:1.5em; font-weight:bold; color:#888; text-shadow:#fff 0 1px 0; } -table { position:relative; width:100%; } +table { position:relative; top:37px; width:100%; } tbody tr { background-color:#fff; height:2.5em; } tbody tr:hover, tbody tr:active, tbody tr.selected { background-color:#f8f8f8; } tbody tr.selected { background-color:#eee; } @@ -73,9 +73,9 @@ table th#headerSize, table td.filesize { min-width:3em; padding:0 1em; text-alig table th#headerDate, table td.date { min-width:11em; padding:0 .1em 0 1em; text-align:left; } /* Multiselect bar */ -table.multiselect thead { position:fixed; z-index:1; } +table.multiselect { top:63px; } +table.multiselect thead { position:fixed; top:82px; z-index:1; } table.multiselect thead th { background:rgba(230,230,230,.8); color:#000; font-weight:bold; border-bottom:0; } -table.multiselect tbody { position: absolute; margin-top:2em; } table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; } table td.filename a.name { display:block; height:1.5em; vertical-align:middle; margin-left:3em; } table tr[data-type="dir"] td.filename a.name span.nametext {font-weight:bold; } diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 0b4aa21eac3..2d4ed9ab2d9 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -59,7 +59,7 @@
        t('Nothing in here. Upload something!')?>
        -
        t('Login Name')?>
        +
        -- cgit v1.2.3 From 25b5b39e7aaf2931e1c726982bf6c82951f0ce3b Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 11 Feb 2013 12:23:53 +0100 Subject: Files: fix width of table header when files are selected --- apps/files/css/files.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'apps/files/css/files.css') diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 620fe8606be..1dae49c1cf4 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -25,7 +25,7 @@ #trash { height:17px; margin: 0 1em; z-index:1010; float: right; } -#upload { +#upload { height:27px; padding:0; margin-left:0.2em; overflow:hidden; } #upload a { @@ -74,8 +74,9 @@ table th#headerDate, table td.date { min-width:11em; padding:0 .1em 0 1em; text- /* Multiselect bar */ table.multiselect { top:63px; } -table.multiselect thead { position:fixed; top:82px; z-index:1; } +table.multiselect thead { position:fixed; top:82px; z-index:1; -moz-box-sizing: border-box; box-sizing: border-box; left: 0; padding-left: 64px; width:100%; } table.multiselect thead th { background:rgba(230,230,230,.8); color:#000; font-weight:bold; border-bottom:0; } +table.multiselect #headerName { width: 100%; } table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; } table td.filename a.name { display:block; height:1.5em; vertical-align:middle; margin-left:3em; } table tr[data-type="dir"] td.filename a.name span.nametext {font-weight:bold; } -- cgit v1.2.3