diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-03 09:03:43 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-03 09:03:43 +0100 |
commit | d4b356e0e9e1de237c9a86c8a576291a3508aec4 (patch) | |
tree | 08abafedf15a509a68f3b12c279f5746cb78e0fe /core/js/js.js | |
parent | 77942ad38afb982c3b7efa841a9bb0b46a0c039a (diff) | |
parent | 5e08f1df78652e7a16de00041d376f55a4d2009e (diff) | |
download | nextcloud-server-d4b356e0e9e1de237c9a86c8a576291a3508aec4.tar.gz nextcloud-server-d4b356e0e9e1de237c9a86c8a576291a3508aec4.zip |
Merge pull request #21961 from owncloud/comments-gui
Comments GUI in files sidebar
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js index 43ea269c203..bc8c51e40d3 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -82,6 +82,12 @@ var OC={ webroot:oc_webroot, appswebroots:(typeof oc_appswebroots !== 'undefined') ? oc_appswebroots:false, + /** + * Currently logged in user or null if none + * + * @type String + * @deprecated use {@link OC.getCurrentUser} instead + */ currentUser:(typeof oc_current_user!=='undefined')?oc_current_user:false, config: window.oc_config, appConfig: window.oc_appconfig || {}, @@ -272,6 +278,23 @@ var OC={ }, /** + * Returns the currently logged in user or null if there is no logged in + * user (public page mode) + * + * @return {OC.CurrentUser} user spec + * @since 9.0.0 + */ + getCurrentUser: function() { + if (_.isUndefined(this._currentUserDisplayName)) { + this._currentUserDisplayName = document.getElementsByTagName('head')[0].getAttribute('data-user-displayname'); + } + return { + uid: this.currentUser, + displayName: this._currentUserDisplayName + }; + }, + + /** * get the absolute path to an image file * if no extension is given for the image, it will automatically decide * between .png and .svg based on what the browser supports @@ -690,6 +713,15 @@ var OC={ }; /** + * Current user attributes + * + * @typedef {Object} OC.CurrentUser + * + * @property {String} uid user id + * @property {String} displayName display name + */ + +/** * @namespace OC.Plugins */ OC.Plugins = { |