diff --git a/core/js/dist/login.js b/core/js/dist/login.js index 72bdae25f967588352610f96edfc1e9fc8ea1883..00a3b5cfe0731a63fb761d390e42a79459c27279 100644 Binary files a/core/js/dist/login.js and b/core/js/dist/login.js differ diff --git a/core/js/dist/login.js.map b/core/js/dist/login.js.map index 71f2b50df32c9b84d29e1f1d950260c5b47066bb..4804165dcc4a2837b72ec8d5a2aa4e858b49e7b3 100644 Binary files a/core/js/dist/login.js.map and b/core/js/dist/login.js.map differ diff --git a/core/js/dist/main.js b/core/js/dist/main.js index 21270b3f83f5295860df8084f8f569f3eec4138a..99d6652acc7c61ee1b2462645e4c6f823a4fc6af 100644 Binary files a/core/js/dist/main.js and b/core/js/dist/main.js differ diff --git a/core/js/dist/main.js.map b/core/js/dist/main.js.map index 21e0e60a63d10b4518f152ca7864f57ffcc1e7c6..eb31fc2da7aa10b0ccb50bd9c8d546f63be897d1 100644 Binary files a/core/js/dist/main.js.map and b/core/js/dist/main.js.map differ diff --git a/core/js/dist/maintenance.js b/core/js/dist/maintenance.js index deff950b2423ebe9e0efc9c838b15186c7e0ca84..d36a30871807ed940599bb79852f294ed8224e46 100644 Binary files a/core/js/dist/maintenance.js and b/core/js/dist/maintenance.js differ diff --git a/core/js/dist/maintenance.js.map b/core/js/dist/maintenance.js.map index 2c988956ca28a9cc9876b99b343f33f092d118c7..6f81be33b054c592cc203d1854bb2cbe9b12b0ab 100644 Binary files a/core/js/dist/maintenance.js.map and b/core/js/dist/maintenance.js.map differ diff --git a/core/js/tests/specs/coreSpec.js b/core/js/tests/specs/coreSpec.js index f4edbc7cab878c4963dbe641dda5a60ec98e9118..52099bdb26cff3b355b71f9de1bb28792753c2ca 100644 --- a/core/js/tests/specs/coreSpec.js +++ b/core/js/tests/specs/coreSpec.js @@ -900,10 +900,15 @@ describe('Core base tests', function() { var hideSpy; var clock; - var getInnerText = function($node) { - return $node.contents().filter(function(){ - return this.nodeType === 3; - })[0].nodeValue; + /** + * Returns the HTML or plain text of the given notification row. + * + * This is needed to ignore the close button that is added to the + * notification row after the text. + */ + var getNotificationText = function($node) { + return $node.contents()[0].outerHTML || + $node.contents()[0].nodeValue; } beforeEach(function() { @@ -931,7 +936,7 @@ describe('Core base tests', function() { var $row = $('#testArea .toastify'); expect($row).toBeDefined(); - expect(getInnerText($row)).toEqual('My notification test'); + expect(getNotificationText($row)).toEqual('My notification test'); }); it('shows a HTML notification with default timeout', function() { OC.Notification.showTemporary('<a>My notification test</a>', { isHTML: true }); @@ -942,7 +947,7 @@ describe('Core base tests', function() { var $row = $('#testArea .toastify'); expect($row).toBeDefined(); - expect(getInnerText($row)).toEqual('<a>My notification test</a>'); + expect(getNotificationText($row)).toEqual('<a>My notification test</a>'); }); it('hides itself after 7 seconds', function() { OC.Notification.showTemporary(''); diff --git a/core/src/OC/notification.js b/core/src/OC/notification.js index 45af15841231a5269ba1bbdbde09d181b0741c75..427c857f7c33b35eac13e367bb4f5aefd8c86e3b 100644 --- a/core/src/OC/notification.js +++ b/core/src/OC/notification.js @@ -96,7 +96,7 @@ export default { */ showHtml: function (html, options) { options = options || {} - options.showHtml = true + options.isHTML = true options.timeout = (options.timeout === 0) ? -1 : options.timeout const toast = window.OCP.Toast.message(html, options) return $(toast.toastElement) diff --git a/core/src/OCP/toast.js b/core/src/OCP/toast.js index 66272919f2126398a6c81666ed0f0a3c3f1c9f3e..113d37ab412c3b34fc6b85badc88e1ee5660b8b4 100644 --- a/core/src/OCP/toast.js +++ b/core/src/OCP/toast.js @@ -56,12 +56,12 @@ const Toast = { options = options || {}; _.defaults(options, { timeout: 7, - showHtml: false, + isHTML: false, type: undefined, close: true, callback: () => {} }); - if (!options.showHtml) { + if (!options.isHTML) { text = $('<div/>').text(text).html() } let classes = ''