diff --git a/.gitignore b/.gitignore index 09af6808d64..40d6e6ca0fe 100644 --- a/.gitignore +++ b/.gitignore @@ -56,6 +56,7 @@ nbproject # Cloud9IDE .settings.xml +.c9revisions # vim ex mode .vimrc diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 661a2e827a4..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 0 0 1em; z-index:1010; position:absolute; right:13.5em; } +#trash { height:17px; margin: 0 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 */ @@ -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/apps/files/templates/index.php b/apps/files/templates/index.php index 2d4ed9ab2d9..0b4aa21eac3 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -59,7 +59,7 @@
diff --git a/apps/files_versions/ajax/getVersions.php b/apps/files_versions/ajax/getVersions.php
index 600e69cf798..53fc04625c6 100644
--- a/apps/files_versions/ajax/getVersions.php
+++ b/apps/files_versions/ajax/getVersions.php
@@ -5,7 +5,7 @@ $userDirectory = "/".OCP\USER::getUser()."/files";
$source = $_GET['source'];
$count = 5; //show the newest revisions
-if( ($versions = OCA_Versions\Storage::getVersions( $source, $count)) ) {
+if( ($versions = OCA\Files_Versions\Storage::getVersions( $source, $count)) ) {
$versionsFormatted = array();
diff --git a/apps/files_versions/ajax/rollbackVersion.php b/apps/files_versions/ajax/rollbackVersion.php
index f2c211d9c1e..dc5a59cb4af 100644
--- a/apps/files_versions/ajax/rollbackVersion.php
+++ b/apps/files_versions/ajax/rollbackVersion.php
@@ -8,7 +8,7 @@ $userDirectory = "/".OCP\USER::getUser()."/files";
$file = $_GET['file'];
$revision=(int)$_GET['revision'];
-if(OCA_Versions\Storage::rollback( $file, $revision )) {
+if(OCA\Files_Versions\Storage::rollback( $file, $revision )) {
OCP\JSON::success(array("data" => array( "revision" => $revision, "file" => $file )));
}else{
OCP\JSON::error(array("data" => array( "message" => "Could not revert:" . $file )));
diff --git a/apps/files_versions/appinfo/app.php b/apps/files_versions/appinfo/app.php
index edd0a2f7022..f7c6989ce2d 100644
--- a/apps/files_versions/appinfo/app.php
+++ b/apps/files_versions/appinfo/app.php
@@ -1,8 +1,8 @@
assign( 'path', $path );
- $versions = new OCA_Versions\Storage();
+ $versions = new OCA\Files_Versions\Storage();
// roll back to old version if button clicked
if( isset( $_GET['revert'] ) ) {
@@ -52,7 +52,7 @@ if ( isset( $_GET['path'] ) ) {
// show the history only if there is something to show
$count = 999; //show the newest revisions
- if( ($versions = OCA_Versions\Storage::getVersions( $path, $count)) ) {
+ if( ($versions = OCA\Files_Versions\Storage::getVersions( $path, $count)) ) {
$tmpl->assign( 'versions', array_reverse( $versions ) );
diff --git a/apps/files_versions/lib/hooks.php b/apps/files_versions/lib/hooks.php
index 5cefc532895..dc02c605c44 100644
--- a/apps/files_versions/lib/hooks.php
+++ b/apps/files_versions/lib/hooks.php
@@ -10,7 +10,7 @@
* This class contains all hooks.
*/
-namespace OCA_Versions;
+namespace OCA\Files_Versions;
class Hooks {
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index 5063ef3e21c..b54bc4a4422 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -13,7 +13,7 @@
* A class to handle the versioning of files.
*/
-namespace OCA_Versions;
+namespace OCA\Files_Versions;
class Storage {
@@ -195,6 +195,7 @@ class Storage {
$files_view = new \OC_FilesystemView('/'.$uid.'/files');
$local_file = $files_view->getLocalFile($filename);
+ $local_file_md5 = \md5_file( $local_file );
foreach( $matches as $ma ) {
$parts = explode( '.v', $ma );
@@ -206,7 +207,7 @@ class Storage {
$versions[$key]['size'] = $versions_fileview->filesize($filename.'.v'.$version);
// if file with modified date exists, flag it in array as currently enabled version
- ( \md5_file( $ma ) == \md5_file( $local_file ) ? $versions[$key]['fileMatch'] = 1 : $versions[$key]['fileMatch'] = 0 );
+ ( \md5_file( $ma ) == $local_file_md5 ? $versions[$key]['fileMatch'] = 1 : $versions[$key]['fileMatch'] = 0 );
}
diff --git a/autotest.cmd b/autotest.cmd
new file mode 100644
index 00000000000..053860db547
--- /dev/null
+++ b/autotest.cmd
@@ -0,0 +1,117 @@
+::
+:: ownCloud
+::
+:: @author Thomas Müller
+:: @author Tobias Ramforth (translated into Windows batch file)
+::
+:: @copyright 2012 Thomas Müller thomas.mueller@tmit.eu
+::
+@echo off
+
+set DATADIR=data-autotest
+set BASEDIR=%~dp0
+
+:: create autoconfig for sqlite, mysql and postgresql
+echo ^ .\tests\autoconfig-sqlite.php
+echo $AUTOCONFIG ^= array ^( >> .\tests\autoconfig-sqlite.php
+echo 'installed' ^=^> false^, >> .\tests\autoconfig-sqlite.php
+echo 'dbtype' ^=^> 'sqlite'^, >> .\tests\autoconfig-sqlite.php
+echo 'dbtableprefix' ^=^> 'oc_'^, >> .\tests\autoconfig-sqlite.php
+echo 'adminlogin' ^=^> 'admin'^, >> .\tests\autoconfig-sqlite.php
+echo 'adminpass' ^=^> 'admin'^, >> .\tests\autoconfig-sqlite.php
+echo 'directory' ^=^> '%BASEDIR%%DATADIR%'^, >> .\tests\autoconfig-sqlite.php
+echo ^)^; >> .\tests\autoconfig-sqlite.php
+
+echo ^ .\tests\autoconfig-mysql.php
+echo $AUTOCONFIG ^= array ^( >> .\tests\autoconfig-mysql.php
+echo 'installed' ^=^> false^, >> .\tests\autoconfig-mysql.php
+echo 'dbtype' ^=^> 'mysql'^, >> .\tests\autoconfig-mysql.php
+echo 'dbtableprefix' ^=^> 'oc_'^, >> .\tests\autoconfig-mysql.php
+echo 'adminlogin' ^=^> 'admin'^, >> .\tests\autoconfig-mysql.php
+echo 'adminpass' ^=^> 'admin'^, >> .\tests\autoconfig-mysql.php
+echo 'directory' ^=^> '%BASEDIR%%DATADIR%'^, >> .\tests\autoconfig-mysql.php
+echo 'dbuser' ^=^> 'oc_autotest'^, >> .\tests\autoconfig-mysql.php
+echo 'dbname' ^=^> 'oc_autotest'^, >> .\tests\autoconfig-mysql.php
+echo 'dbhost' ^=^> 'localhost'^, >> .\tests\autoconfig-mysql.php
+echo 'dbpass' ^=^> 'owncloud'^, >> .\tests\autoconfig-mysql.php
+echo ^)^; >> .\tests\autoconfig-mysql.php
+
+echo ^ .\tests\autoconfig-pgsql.php
+echo $AUTOCONFIG ^= array ^( >> .\tests\autoconfig-pgsql.php
+echo 'installed' ^=^> false^, >> .\tests\autoconfig-pgsql.php
+echo 'dbtype' ^=^> 'pgsql'^, >> .\tests\autoconfig-pgsql.php
+echo 'dbtableprefix' ^=^> 'oc_'^, >> .\tests\autoconfig-pgsql.php
+echo 'adminlogin' ^=^> 'admin'^, >> .\tests\autoconfig-pgsql.php
+echo 'adminpass' ^=^> 'admin'^, >> .\tests\autoconfig-pgsql.php
+echo 'directory' ^=^> '%BASEDIR%%DATADIR%'^, >> .\tests\autoconfig-pgsql.php
+echo 'dbuser' ^=^> 'oc_autotest'^, >> .\tests\autoconfig-pgsql.php
+echo 'dbname' ^=^> 'oc_autotest'^, >> .\tests\autoconfig-pgsql.php
+echo 'dbhost' ^=^> 'localhost'^, >> .\tests\autoconfig-pgsql.php
+echo 'dbpass' ^=^> 'owncloud'^, >> .\tests\autoconfig-pgsql.php
+echo ^)^; >> .\tests\autoconfig-pgsql.php
+
+echo localhost:5432:*:oc_autotest:owncloud > %APPDATA%\postgresql\pgpass.conf
+
+::
+:: start test execution
+::
+::call:execute_tests "sqlite"
+call:execute_tests "mysql"
+::call:execute_tests "mssql"
+::call:execute_tests "ora"
+::call:execute_tests "pgsql"
+
+goto:eof
+
+:execute_tests
+ echo "Setup environment for %~1 testing ..."
+ :: back to root folder
+ cd %BASEDIR%
+
+ :: revert changes to tests\data
+ git checkout tests\data\*
+
+ :: reset data directory
+ rmdir /s /q %DATADIR%
+ md %DATADIR%
+
+ :: remove the old config file
+ :: del /q /f config\config.php
+ copy /y tests\preseed-config.php config\config.php
+
+ :: drop database
+ if "%~1" == "mysql" mysql -u oc_autotest -powncloud -e "DROP DATABASE oc_autotest"
+
+ if "%~1" == "pgsql" dropdb -h localhost -p 5432 -U oc_autotest -w oc_autotest
+
+ :: copy autoconfig
+ copy /y %BASEDIR%\tests\autoconfig-%~1.php %BASEDIR%\config\autoconfig.php
+
+ :: trigger installation
+ php -f index.php
+
+ ::test execution
+ echo "Testing with %~1 ..."
+ cd tests
+ rmdir /s /q coverage-html-%~1
+ md coverage-html-%~1
+ php -f enable_all.php
+ ::phpunit --log-junit autotest-results-%~1.xml --coverage-clover autotest-clover-%~1.xml --coverage-html coverage-html-%~1
+ ::phpunit --bootstrap bootstrap.php --configuration phpunit.xml
+ php win32-phpunit.php --bootstrap bootstrap.php --configuration phpunit.xml --log-junit autotest-results-%~1.xml --coverage-clover autotest-clover-%~1.xml --coverage-html coverage-html-%~1
+ echo "Done with testing %~1 ..."
+ cd %BASEDIR%
+goto:eof
+
+::
+:: NOTES on mysql:
+:: - CREATE USER 'oc_autotest'@'localhost' IDENTIFIED BY 'owncloud';
+:: - grant access permissions: grant all on oc_autotest.* to 'oc_autotest'@'localhost';
+::
+:: NOTES on pgsql:
+:: - su - postgres
+:: - createuser -P (enter username and password and enable superuser)
+:: - to enable dropdb I decided to add following line to pg_hba.conf (this is not the safest way but I don't care for the testing machine):
+:: local all all trust
+::
+
diff --git a/core/css/styles.css b/core/css/styles.css
index 6a2773c2d9d..268040525bf 100644
--- a/core/css/styles.css
+++ b/core/css/styles.css
@@ -119,18 +119,26 @@ 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 {
+ 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: 2.9em; }
#content-wrapper {
position:absolute; height:100%; width:100%; padding-top:3.5em; padding-left:64px;
-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; }
@@ -191,7 +199,7 @@ input[name="password-clone"] { padding-left:1.8em; width:11.7em !important; }
/* NEEDED FOR INFIELD LABELS */
p.infield { position:relative; }
label.infield { cursor:text !important; top:1.05em; left:.85em; }
-#login form label.infield { position:absolute; font-size:19px; color:#aaa; white-space:nowrap; padding-left:1.2em; }
+#login form label.infield { position:absolute; font-size:19px; color:#aaa; white-space:nowrap; padding-left:1.4em; }
#login form input[type="checkbox"]+label { position:relative; margin:0; font-size:1em; text-shadow:#fff 0 1px 0; }
#login form .errors { background:#fed7d7; border:1px solid #f00; list-style-indent:inside; margin:0 0 2em; padding:1em; }
diff --git a/settings/css/settings.css b/settings/css/settings.css
index e722cca91ee..9dd17daaeb7 100644
--- a/settings/css/settings.css
+++ b/settings/css/settings.css
@@ -33,7 +33,6 @@ tr:hover>td.password>span, tr:hover>td.displayName>span { margin:0; cursor:point
tr:hover>td.remove>a, tr:hover>td.password>img,tr:hover>td.displayName>img, tr:hover>td.quota>img { visibility:visible; cursor:pointer; }
tr:hover>td.remove>a { float:right; }
li.selected { background-color:#ddd; }
-#content>table:not(.nostyle) { margin-top:3em; }
table:not(.nostyle) { width:100%; }
#rightcontent { padding-left: 1em; }
div.quota { float:right; display:block; position:absolute; right:25em; top:0; }
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');?>
-
|
|---|