diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-02-20 14:49:54 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-02-20 14:49:54 +0100 |
commit | 6cf83de60e577fa13c0e3963761153c26b854c01 (patch) | |
tree | 471f4bfcae0c199ba5e0ca0411140b0f4665a91c | |
parent | 3219433e20d05390aa29c4e9e676f821b48b3ffc (diff) | |
parent | 577559458dd7aa74e32ab62216a22bbc75009866 (diff) | |
download | nextcloud-server-6cf83de60e577fa13c0e3963761153c26b854c01.tar.gz nextcloud-server-6cf83de60e577fa13c0e3963761153c26b854c01.zip |
Merge branch 'patch-1' of github.com:GuillaumeAmat/core into GuillaumeAmat-patch-1
-rw-r--r-- | apps/files/js/filelist.js | 34 | ||||
-rw-r--r-- | core/js/config.php | 17 |
2 files changed, 48 insertions, 3 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index d6cffde05de..6bf134eed3b 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -19,6 +19,15 @@ window.FileList={ }); }, /** + * Sets a new page title + */ + setPageTitle: function(title){ + // Sets the page title with the " - ownCloud" suffix as in templates + window.document.title = title + ' - ' + oc_defaults.title; + + return true; + }, + /** * Returns the tr element for a given file name */ findFileEl: function(fileName){ @@ -186,12 +195,22 @@ window.FileList={ changeDirectory: function(targetDir, changeUrl, force) { var $dir = $('#dir'), url, - currentDir = $dir.val() || '/'; + currentDir = $dir.val() || '/', + baseDir = OC.basename(targetDir), targetDir = targetDir || '/'; if (!force && currentDir === targetDir) { return; } + + if (baseDir !== '') { + FileList.setPageTitle(baseDir); + } + else { + FileList.setPageTitle(t('files', 'Files')); + } + FileList.setCurrentDir(targetDir, changeUrl); + $('#fileList').trigger( jQuery.Event('changeDirectory', { dir: targetDir, @@ -847,7 +866,8 @@ window.FileList={ }; $(document).ready(function() { - var isPublic = !!$('#isPublic').val(); + var baseDir, + isPublic = !!$('#isPublic').val(); // handle upload events var file_upload_start = $('#file_upload_start'); @@ -1131,6 +1151,14 @@ $(document).ready(function() { FileList.changeDirectory(parseCurrentDirFromUrl(), false, true); } } - + + + baseDir = OC.basename(parseCurrentDirFromUrl()); + + if (baseDir !== '') { + FileList.setPageTitle(baseDir); + } + + FileList.createFileSummary(); }); diff --git a/core/js/config.php b/core/js/config.php index b6875fb73f9..e79b4541301 100644 --- a/core/js/config.php +++ b/core/js/config.php @@ -16,6 +16,9 @@ header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Enable l10n support $l = OC_L10N::get('core'); +// Enable OC_Defaults support +$defaults = new OC_Defaults(); + // Get the config $apps_paths = array(); foreach(OC_App::getEnabledApps() as $app) { @@ -60,6 +63,20 @@ $array = array( 'session_lifetime' => \OCP\Config::getSystemValue('session_lifetime', ini_get('session.gc_maxlifetime')), 'session_keepalive' => \OCP\Config::getSystemValue('session_keepalive', true) ) + ), + "oc_defaults" => json_encode( + array( + 'entity' => $defaults->getEntity(), + 'name' => $defaults->getName(), + 'title' => $defaults->getTitle(), + 'baseUrl' => $defaults->getBaseUrl(), + 'syncClientUrl' => $defaults->getSyncClientUrl(), + 'docBaseUrl' => $defaults->getDocBaseUrl(), + 'slogan' => $defaults->getSlogan(), + 'logoClaim' => $defaults->getLogoClaim(), + 'shortFooter' => $defaults->getShortFooter(), + 'longFooter' => $defaults->getLongFooter() + ) ) ); |