diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-07-05 00:41:59 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-07-05 14:33:08 +0200 |
commit | 772bbd99bee83d17707c73a630a4d47c4b8bc807 (patch) | |
tree | 9cc5293fe3454e3e71be018b80825a5686516ae5 /core/js | |
parent | cbfcfb236f3e8ace6c64ab5a654b9a331a3ce1c0 (diff) | |
download | nextcloud-server-772bbd99bee83d17707c73a630a4d47c4b8bc807.tar.gz nextcloud-server-772bbd99bee83d17707c73a630a4d47c4b8bc807.zip |
Backend work to provide NC whats New info to users
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/core.json | 1 | ||||
-rw-r--r-- | core/js/merged-template-prepend.json | 1 | ||||
-rw-r--r-- | core/js/public/whatsnew.js | 54 |
3 files changed, 56 insertions, 0 deletions
diff --git a/core/js/core.json b/core/js/core.json index 41b927147b6..502e3a57976 100644 --- a/core/js/core.json +++ b/core/js/core.json @@ -48,6 +48,7 @@ "public/appconfig.js", "public/comments.js", "public/publicpage.js", + "public/whatsnew.js", "multiselect.js", "oc-requesttoken.js", "setupchecks.js", diff --git a/core/js/merged-template-prepend.json b/core/js/merged-template-prepend.json index f4ef511bc78..c274201d97e 100644 --- a/core/js/merged-template-prepend.json +++ b/core/js/merged-template-prepend.json @@ -7,6 +7,7 @@ "eventsource.js", "public/appconfig.js", "public/comments.js", + "public/whatsnew.js", "config.js", "oc-requesttoken.js", "apps.js", diff --git a/core/js/public/whatsnew.js b/core/js/public/whatsnew.js new file mode 100644 index 00000000000..dc5862e8572 --- /dev/null +++ b/core/js/public/whatsnew.js @@ -0,0 +1,54 @@ +/** + * @copyright (c) 2017 Arthur Schiwon <blizzz@arthur-schiwon.de> + * + * @author Arthur Schiwon <blizzz@arthur-schiwon.de> + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + */ + +(function(OCP) { + "use strict"; + + OCP.WhatsNew = { + + query: function(options) { + options = options || {}; + $.ajax({ + type: 'GET', + url: options.url || OC.linkToOCS('core', 2) + 'whatsnew?format=json', + success: options.success || this._onQuerySuccess, + error: options.error || this._onQueryError + }); + }, + + dismiss: function(version, options) { + options = options || {}; + $.ajax({ + type: 'POST', + url: options.url || OC.linkToOCS('core', 2) + 'whatsnew', + data: {version: encodeURIComponent(version)}, + success: options.success || this._onDismissSuccess, + error: options.error || this._onDismissError + }); + }, + + _onQuerySuccess: function(data, statusText) { + console.debug('querying Whats New data was successful: ' + data || statusText); + console.debug(data); + }, + + _onQueryError: function (o, t, e) { + console.debug(o); + console.debug('querying Whats New Data resulted in an error: ' + t +e); + }, + + _onDismissSuccess: function(data) { + console.debug('dismissing Whats New data was successful: ' + data); + }, + + _onDismissError: function (data) { + console.debug('dismissing Whats New data resulted in an error: ' + data); + } + }; +})(OCP); |