summaryrefslogtreecommitdiffstats
path: root/core/js/public/whatsnew.js
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2019-01-29 14:50:05 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2019-01-30 13:56:01 +0100
commit9a46c9ed31785c66f3d89f4760452d66f9674321 (patch)
treeb5f3ca6bab9fb10b03c5ea7453cae2d1c1b47b8e /core/js/public/whatsnew.js
parentfda74eb9b9e6e0da4dbe222d2d9a1ceddaf60d59 (diff)
downloadnextcloud-server-9a46c9ed31785c66f3d89f4760452d66f9674321.tar.gz
nextcloud-server-9a46c9ed31785c66f3d89f4760452d66f9674321.zip
Move OCP.AppCOnfig, OCP.Comments and OCP.WhatsNew to the server bundle
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'core/js/public/whatsnew.js')
-rw-r--r--core/js/public/whatsnew.js134
1 files changed, 0 insertions, 134 deletions
diff --git a/core/js/public/whatsnew.js b/core/js/public/whatsnew.js
deleted file mode 100644
index cd6873cfb3f..00000000000
--- a/core/js/public/whatsnew.js
+++ /dev/null
@@ -1,134 +0,0 @@
-/**
- * @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 || {};
- var dismissOptions = options.dismiss || {};
- $.ajax({
- type: 'GET',
- url: options.url || OC.linkToOCS('core', 2) + 'whatsnew?format=json',
- success: options.success || function(data, statusText, xhr) {
- OCP.WhatsNew._onQuerySuccess(data, statusText, xhr, dismissOptions);
- },
- 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
- });
- // remove element immediately
- $('.whatsNewPopover').remove();
- },
-
- _onQuerySuccess: function(data, statusText, xhr, dismissOptions) {
- console.debug('querying Whats New data was successful: ' + statusText);
- console.debug(data);
-
- if(xhr.status !== 200) {
- return;
- }
-
- var item, menuItem, text, icon;
-
- var div = document.createElement('div');
- div.classList.add('popovermenu', 'open', 'whatsNewPopover', 'menu-left');
-
- var list = document.createElement('ul');
-
- // header
- item = document.createElement('li');
- menuItem = document.createElement('span');
- menuItem.className = "menuitem";
-
- text = document.createElement('span');
- text.innerText = t('core', 'New in') + ' ' + data['ocs']['data']['product'];
- text.className = 'caption';
- menuItem.appendChild(text);
-
- icon = document.createElement('span');
- icon.className = 'icon-close';
- icon.onclick = function () {
- OCP.WhatsNew.dismiss(data['ocs']['data']['version'], dismissOptions);
- };
- menuItem.appendChild(icon);
-
- item.appendChild(menuItem);
- list.appendChild(item);
-
- // Highlights
- for (var i in data['ocs']['data']['whatsNew']['regular']) {
- var whatsNewTextItem = data['ocs']['data']['whatsNew']['regular'][i];
- item = document.createElement('li');
-
- menuItem = document.createElement('span');
- menuItem.className = "menuitem";
-
- icon = document.createElement('span');
- icon.className = 'icon-checkmark';
- menuItem.appendChild(icon);
-
- text = document.createElement('p');
- text.innerHTML = _.escape(whatsNewTextItem);
- menuItem.appendChild(text);
-
- item.appendChild(menuItem);
- list.appendChild(item);
- }
-
- // Changelog URL
- if(!_.isUndefined(data['ocs']['data']['changelogURL'])) {
- item = document.createElement('li');
-
- menuItem = document.createElement('a');
- menuItem.href = data['ocs']['data']['changelogURL'];
- menuItem.rel = 'noreferrer noopener';
- menuItem.target = '_blank';
-
- icon = document.createElement('span');
- icon.className = 'icon-link';
- menuItem.appendChild(icon);
-
- text = document.createElement('span');
- text.innerText = t('core', 'View changelog');
- menuItem.appendChild(text);
-
- item.appendChild(menuItem);
- list.appendChild(item);
- }
-
- div.appendChild(list);
- document.body.appendChild(div);
- },
-
- _onQueryError: function (x, t, e) {
- console.debug('querying Whats New Data resulted in an error: ' + t + e);
- console.debug(x);
- },
-
- _onDismissSuccess: function(data) {
- //noop
- },
-
- _onDismissError: function (data) {
- console.debug('dismissing Whats New data resulted in an error: ' + data);
- }
- };
-})(OCP);