summaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-08-29 08:42:49 +0200
committerBart Visscher <bartv@thisnet.nl>2012-08-29 20:29:43 +0200
commit0e58800016419daf3b2d032136415a5fe9d6331f (patch)
treec842a8c9104b3c9f2ceab2d505fe01a25f7d0dda /apps/files_versions
parent52f2e7112ea985203eca16aa787bd75a7cf92194 (diff)
downloadnextcloud-server-0e58800016419daf3b2d032136415a5fe9d6331f.tar.gz
nextcloud-server-0e58800016419daf3b2d032136415a5fe9d6331f.zip
Whitespace fixes in apps
Diffstat (limited to 'apps/files_versions')
-rw-r--r--apps/files_versions/ajax/expireAll.php8
-rw-r--r--apps/files_versions/ajax/getVersions.php8
-rw-r--r--apps/files_versions/appinfo/update.php4
-rw-r--r--apps/files_versions/history.php40
-rw-r--r--apps/files_versions/js/settings-personal.js28
-rw-r--r--apps/files_versions/js/versions.js30
-rw-r--r--apps/files_versions/templates/history.php4
7 files changed, 61 insertions, 61 deletions
diff --git a/apps/files_versions/ajax/expireAll.php b/apps/files_versions/ajax/expireAll.php
index 2a678c7f0a5..f76da3da986 100644
--- a/apps/files_versions/ajax/expireAll.php
+++ b/apps/files_versions/ajax/expireAll.php
@@ -32,13 +32,13 @@ OCP\JSON::callCheck();
$versions = new OCA_Versions\Storage();
if( $versions->expireAll() ){
-
+
OCP\JSON::success();
die();
-
+
} else {
-
+
OCP\JSON::error();
die();
-
+
} \ No newline at end of file
diff --git a/apps/files_versions/ajax/getVersions.php b/apps/files_versions/ajax/getVersions.php
index 1a0e21732cc..8476e5e8a51 100644
--- a/apps/files_versions/ajax/getVersions.php
+++ b/apps/files_versions/ajax/getVersions.php
@@ -9,19 +9,19 @@ if( OCA_Versions\Storage::isversioned( $source ) ) {
$count=5; //show the newest revisions
$versions = OCA_Versions\Storage::getVersions( $source, $count);
$versionsFormatted = array();
-
+
foreach ( $versions AS $version ) {
$versionsFormatted[] = OCP\Util::formatDate( $version['version'] );
}
$versionsSorted = array_reverse( $versions );
-
+
if ( !empty( $versionsSorted ) ) {
OCP\JSON::encodedPrint($versionsSorted);
}
-
+
} else {
return;
-
+
}
diff --git a/apps/files_versions/appinfo/update.php b/apps/files_versions/appinfo/update.php
index 9569ca10485..e289b927b3c 100644
--- a/apps/files_versions/appinfo/update.php
+++ b/apps/files_versions/appinfo/update.php
@@ -6,11 +6,11 @@ if (version_compare($installedVersion, '1.0.2', '<')) {
$users = \OCP\User::getUsers();
$datadir = \OCP\Config::getSystemValue('datadirectory').'/';
foreach ($users as $user) {
- $oldPath = $datadir.$user.'/versions';
+ $oldPath = $datadir.$user.'/versions';
$newPath = $datadir.$user.'/files_versions';
if(is_dir($oldPath)) {
rename($oldPath, $newPath);
}
}
-
+
}
diff --git a/apps/files_versions/history.php b/apps/files_versions/history.php
index 27dc8bfc382..ea36d6d9f88 100644
--- a/apps/files_versions/history.php
+++ b/apps/files_versions/history.php
@@ -5,20 +5,20 @@
*
* @author Frank Karlitschek
* @copyright 2012 Frank Karlitschek frank@owncloud.org
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
- * License as published by the Free Software Foundation; either
+ * License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
+ *
+ * You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
+ *
*/
OCP\User::checkLoggedIn( );
@@ -34,40 +34,40 @@ if ( isset( $_GET['path'] ) ) {
// roll back to old version if button clicked
if( isset( $_GET['revert'] ) ) {
-
+
if( $versions->rollback( $path, $_GET['revert'] ) ) {
-
+
$tmpl->assign( 'outcome_stat', 'success' );
-
+
$tmpl->assign( 'outcome_msg', "File {$_GET['path']} was reverted to version ".OCP\Util::formatDate( doubleval($_GET['revert']) ) );
-
+
} else {
-
+
$tmpl->assign( 'outcome_stat', 'failure' );
-
+
$tmpl->assign( 'outcome_msg', "File {$_GET['path']} could not be reverted to version ".OCP\Util::formatDate( doubleval($_GET['revert']) ) );
-
+
}
-
+
}
// show the history only if there is something to show
if( OCA_Versions\Storage::isversioned( $path ) ) {
-
+
$count = 999; //show the newest revisions
$versions = OCA_Versions\Storage::getVersions( $path, $count);
$tmpl->assign( 'versions', array_reverse( $versions ) );
-
+
}else{
-
+
$tmpl->assign( 'message', 'No old versions available' );
-
+
}
}else{
-
+
$tmpl->assign( 'message', 'No path specified' );
-
+
}
$tmpl->printPage( );
diff --git a/apps/files_versions/js/settings-personal.js b/apps/files_versions/js/settings-personal.js
index 6ea8c1a950f..1e6b036fdab 100644
--- a/apps/files_versions/js/settings-personal.js
+++ b/apps/files_versions/js/settings-personal.js
@@ -2,16 +2,16 @@
$( document ).ready(function(){
//
- $( '#expireAllBtn' ).click(
-
+ $( '#expireAllBtn' ).click(
+
function( event ) {
-
+
// Prevent page from reloading
event.preventDefault();
-
+
// Show loading gif
$('.expireAllLoading').show();
-
+
$.getJSON(
OC.filePath('files_versions','ajax','expireAll.php'),
function(result){
@@ -19,20 +19,20 @@ $( document ).ready(function(){
$('.expireAllLoading').hide();
$('#expireAllBtn').html('Expiration successful');
} else {
-
+
// Cancel loading
$('#expireAllBtn').html('Expiration failed');
-
+
// Show Dialog
OC.dialogs.alert(
- 'Something went wrong, your files may not have been expired',
- 'An error has occurred',
- function(){
- $('#expireAllBtn').html(t('files_versions', 'Expire all versions')+'<img style="display: none;" class="loading" src="'+OC.filePath('core','img','loading.gif')+'" />');
- }
- );
+ 'Something went wrong, your files may not have been expired',
+ 'An error has occurred',
+ function(){
+ $('#expireAllBtn').html(t('files_versions', 'Expire all versions')+'<img style="display: none;" class="loading" src="'+OC.filePath('core','img','loading.gif')+'" />');
+ }
+ );
}
- }
+ }
);
}
);
diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js
index c5c1553f1a8..e34a6f50cac 100644
--- a/apps/files_versions/js/versions.js
+++ b/apps/files_versions/js/versions.js
@@ -14,7 +14,7 @@ $(document).ready(function(){
FileActions.register('file','History', FileActions.PERMISSION_UPDATE, function(){return OC.imagePath('core','actions/history')},function(filename){
if (scanFiles.scanning){return;}//workaround to prevent additional http request block scanning feedback
-
+
var file = $('#dir').val()+'/'+filename;
// Check if drop down is already visible for a different file
if (($('#dropdown').length > 0)) {
@@ -35,7 +35,7 @@ $(document).ready(function(){
function createVersionsDropdown(filename, files) {
var historyUrl = OC.linkTo('files_versions', 'history.php') + '?path='+encodeURIComponent( $( '#dir' ).val() ).replace( /%2F/g, '/' )+'/'+encodeURIComponent( filename );
-
+
var html = '<div id="dropdown" class="drop" data-file="'+files+'">';
html += '<div id="private">';
html += '<select data-placeholder="Saved versions" id="found_versions" class="chzen-select" style="width:16em;">';
@@ -45,14 +45,14 @@ function createVersionsDropdown(filename, files) {
//html += '<input type="button" value="Revert file" onclick="revertFile()" />';
html += '<input type="button" value="All versions..." onclick="window.location=\''+historyUrl+'\'" name="makelink" id="makelink" />';
html += '<input id="link" style="display:none; width:90%;" />';
-
+
if (filename) {
$('tr').filterAttr('data-file',filename).addClass('mouseOver');
$(html).appendTo($('tr').filterAttr('data-file',filename).find('td.filename'));
} else {
$(html).appendTo($('thead .share'));
}
-
+
$.ajax({
type: 'GET',
url: OC.filePath('files_versions', 'ajax', 'getVersions.php'),
@@ -60,9 +60,9 @@ function createVersionsDropdown(filename, files) {
data: { source: files },
async: false,
success: function( versions ) {
-
+
//alert("helo "+OC.linkTo('files_versions', 'ajax/getVersions.php'));
-
+
if (versions) {
$.each( versions, function(index, row ) {
addVersion( row );
@@ -79,9 +79,9 @@ function createVersionsDropdown(filename, files) {
})
}
});
-
+
function revertFile(file, revision) {
-
+
$.ajax({
type: 'GET',
url: OC.linkTo('files_versions', 'ajax/rollbackVersion.php'),
@@ -99,16 +99,16 @@ function createVersionsDropdown(filename, files) {
});
}
}
- });
-
+ });
+
}
-
+
function addVersion(revision ) {
name=formatDate(revision.version*1000);
var version=$('<option/>');
version.attr('value',revision.version);
version.text(name);
-
+
// } else {
// var checked = ((permissions > 0) ? 'checked="checked"' : 'style="display:none;"');
// var style = ((permissions == 0) ? 'style="display:none;"' : '');
@@ -119,11 +119,11 @@ function createVersionsDropdown(filename, files) {
// user += '<label for="'+uid_shared_with+'" '+style+'>can edit</label>';
// user += '</li>';
// }
-
+
version.appendTo('#found_versions');
}
$('#dropdown').show('blind');
-
-
+
+
}
diff --git a/apps/files_versions/templates/history.php b/apps/files_versions/templates/history.php
index 1b442556421..d4f875a36e8 100644
--- a/apps/files_versions/templates/history.php
+++ b/apps/files_versions/templates/history.php
@@ -11,14 +11,14 @@ if( isset( $_['message'] ) ) {
}else{
if( isset( $_['outcome_stat'] ) ) {
-
+
echo( '<div id="feedback-messages" class="'.$_['outcome_stat'].'"><h3>'.$_['outcome_msg'] ).'</h3></div><br>';
}
echo( '<strong>Versions of '.$_['path'] ).'</strong><br>';
echo('<p><em>Revert a file to a previous version by clicking on its revert button</em></p><br />');
-
+
foreach ( $_['versions'] as $v ) {
echo ' ';
echo OCP\Util::formatDate( doubleval($v['version']) );