diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 442fdec93229b..6b964981a476d 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -666,7 +666,7 @@ * @param {string} [tabId] optional tab id to select */ showDetailsView: function(fileName, tabId) { - console.warn('showDetailsView is deprecated! Use OCA.Files.Sidebar.activeTab. It will be removed in nextcloud 20.'); + OC.debug && console.warn('showDetailsView is deprecated! Use OCA.Files.Sidebar.activeTab. It will be removed in nextcloud 20.'); this._updateDetailsView(fileName); if (tabId) { OCA.Files.Sidebar.setActiveTab(tabId); @@ -3879,7 +3879,7 @@ * Register a tab view to be added to all views */ registerTabView: function(tabView) { - console.warn('registerTabView is deprecated! It will be removed in nextcloud 20.'); + OC.debug && console.warn('registerTabView is deprecated! It will be removed in nextcloud 20.'); const enabled = tabView.canDisplay || undefined if (tabView.id) { OCA.Files.Sidebar.registerTab(new OCA.Files.Sidebar.Tab({ @@ -3905,7 +3905,7 @@ * Register a detail view to be added to all views */ registerDetailView: function(detailView) { - console.warn('registerDetailView is deprecated! It will be removed in nextcloud 20.'); + OC.debug && console.warn('registerDetailView is deprecated! It will be removed in nextcloud 20.'); if (detailView.el) { OCA.Files.Sidebar.registerSecondaryView(detailView) } diff --git a/apps/files/js/files.js b/apps/files/js/files.js index b0c3824818309..1788ebe9d3f5e 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -281,7 +281,7 @@ * @deprecated used OCA.Files.FileList.generatePreviewUrl instead */ generatePreviewUrl: function(urlSpec) { - console.warn('DEPRECATED: please use generatePreviewUrl() from an OCA.Files.FileList instance'); + OC.debug && console.warn('DEPRECATED: please use generatePreviewUrl() from an OCA.Files.FileList instance'); return OCA.Files.App.fileList.generatePreviewUrl(urlSpec); }, @@ -290,7 +290,7 @@ * @deprecated used OCA.Files.FileList.lazyLoadPreview instead */ lazyLoadPreview : function(path, mime, ready, width, height, etag) { - console.warn('DEPRECATED: please use lazyLoadPreview() from an OCA.Files.FileList instance'); + OC.debug && console.warn('DEPRECATED: please use lazyLoadPreview() from an OCA.Files.FileList instance'); return FileList.lazyLoadPreview({ path: path, mime: mime, diff --git a/apps/files_sharing/src/services/ExternalLinkActions.js b/apps/files_sharing/src/services/ExternalLinkActions.js index 06cf97ed255e9..1975b38808adb 100644 --- a/apps/files_sharing/src/services/ExternalLinkActions.js +++ b/apps/files_sharing/src/services/ExternalLinkActions.js @@ -52,7 +52,7 @@ export default class ExternalLinkActions { * @return {boolean} */ registerAction(action) { - console.warn('OCA.Sharing.ExternalLinkActions is deprecated, use OCA.Sharing.ExternalShareAction instead') + OC.debug && console.warn('OCA.Sharing.ExternalLinkActions is deprecated, use OCA.Sharing.ExternalShareAction instead') if (typeof action === 'object' && action.icon && action.name && action.url) { this._state.actions.push(action) diff --git a/core/src/OC/appsettings.js b/core/src/OC/appsettings.js index ee41b7c6f85cd..54eebe8e5614e 100644 --- a/core/src/OC/appsettings.js +++ b/core/src/OC/appsettings.js @@ -38,7 +38,7 @@ import { generateFilePath } from "@nextcloud/router" * @deprecated 17.0.0 this method is unused and will be removed with Nextcloud 18 */ export const appSettings = args => { - console.warn('OC.appSettings is deprecated and will be removed with Nextcloud 18') + OC.debug && console.warn('OC.appSettings is deprecated and will be removed with Nextcloud 18') if (typeof args === 'undefined' || typeof args.appid === 'undefined') { throw { diff --git a/core/src/OC/capabilities.js b/core/src/OC/capabilities.js index c7df9b4f3d1ef..72a71d7c74350 100644 --- a/core/src/OC/capabilities.js +++ b/core/src/OC/capabilities.js @@ -32,6 +32,6 @@ import { getCapabilities as realGetCapabilities } from '@nextcloud/capabilities' * @since 14.0.0 */ export const getCapabilities = () => { - console.warn('OC.getCapabilities is deprecated and will be removed in Nextcloud 21. See @nextcloud/capabilities') + OC.debug && console.warn('OC.getCapabilities is deprecated and will be removed in Nextcloud 21. See @nextcloud/capabilities') return realGetCapabilities() } diff --git a/core/src/OC/legacy-loader.js b/core/src/OC/legacy-loader.js index e5bbac8f3a056..b214ac0de9891 100644 --- a/core/src/OC/legacy-loader.js +++ b/core/src/OC/legacy-loader.js @@ -40,7 +40,7 @@ const loadedStyles = [] * @deprecated 16.0.0 Use OCP.Loader.loadScript */ export const addScript = (app, script, ready) => { - console.warn('OC.addScript is deprecated, use OCP.Loader.loadScript instead') + OC.debug && console.warn('OC.addScript is deprecated, use OCP.Loader.loadScript instead') let deferred const path = generateFilePath(app, 'js', script + '.js') @@ -64,7 +64,7 @@ export const addScript = (app, script, ready) => { * @deprecated 16.0.0 Use OCP.Loader.loadStylesheet */ export const addStyle = (app, style) => { - console.warn('OC.addStyle is deprecated, use OCP.Loader.loadStylesheet instead') + OC.debug && console.warn('OC.addStyle is deprecated, use OCP.Loader.loadStylesheet instead') const path = generateFilePath(app, 'css', style + '.css') if (loadedStyles.indexOf(path) === -1) { diff --git a/core/src/OC/util.js b/core/src/OC/util.js index 8a50808b5cbf5..f0dd7e0ac143e 100644 --- a/core/src/OC/util.js +++ b/core/src/OC/util.js @@ -124,7 +124,7 @@ export default { */ formatDate(timestamp, format) { if (window.TESTING === undefined) { - console.warn('OC.Util.formatDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment') + OC.debug && console.warn('OC.Util.formatDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment') } format = format || 'LLL' return moment(timestamp).format(format) @@ -136,7 +136,7 @@ export default { */ relativeModifiedDate(timestamp) { if (window.TESTING === undefined) { - console.warn('OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment') + OC.debug && console.warn('OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment') } const diff = moment().diff(moment(timestamp)) if (diff >= 0 && diff < 45000) { diff --git a/core/src/OCA/search.js b/core/src/OCA/search.js index 10b629a0cf3a9..f0395c0bcd5c9 100644 --- a/core/src/OCA/search.js +++ b/core/src/OCA/search.js @@ -26,7 +26,7 @@ export default class Search { * @deprecated 20.0.0, will be removed in Nextcloud 22 */ constructor() { - console.warn('OCA.Search is deprecated. Please use the unified search API instead') + OC.debug && console.warn('OCA.Search is deprecated. Please use the unified search API instead') } } diff --git a/core/src/Polyfill/tooltip.js b/core/src/Polyfill/tooltip.js index 452cb30305bdd..925b67c3e8bf8 100644 --- a/core/src/Polyfill/tooltip.js +++ b/core/src/Polyfill/tooltip.js @@ -31,13 +31,13 @@ $.prototype.tooltip = (function(tooltip) { } catch (ex) { if (ex instanceof TypeError && config === 'destroy') { if (window.TESTING === undefined) { - console.error('Deprecated call $.tooltip(\'destroy\') has been deprecated and should be removed') + OC.debug && console.warn('Deprecated call $.tooltip(\'destroy\') has been deprecated and should be removed') } return tooltip.call(this, 'dispose') } if (ex instanceof TypeError && config === 'fixTitle') { if (window.TESTING === undefined) { - console.error('Deprecated call $.tooltip(\'fixTitle\') has been deprecated and should be removed') + OC.debug && console.warn('Deprecated call $.tooltip(\'fixTitle\') has been deprecated and should be removed') } return tooltip.call(this, '_fixTitle') } diff --git a/core/src/globals.js b/core/src/globals.js index 8d60bde6eb05a..1a4c05827680c 100644 --- a/core/src/globals.js +++ b/core/src/globals.js @@ -56,7 +56,7 @@ import { getToken as getRequestToken } from './OC/requesttoken.js' const warnIfNotTesting = function() { if (window.TESTING === undefined) { - console.warn.apply(console, arguments) + OC.debug && console.warn.apply(console, arguments) } } diff --git a/core/src/jquery/placeholder.js b/core/src/jquery/placeholder.js index 0364705913138..9e24216a1b571 100644 --- a/core/src/jquery/placeholder.js +++ b/core/src/jquery/placeholder.js @@ -140,7 +140,7 @@ const toRgb = (s) => { } String.prototype.toRgb = function() { - console.warn('String.prototype.toRgb is deprecated! It will be removed in Nextcloud 22.') + OC.debug && console.warn('String.prototype.toRgb is deprecated! It will be removed in Nextcloud 22.') return toRgb(this) } diff --git a/dist/core-install.js b/dist/core-install.js index 7fac43c39eb98..240affd0fbe05 100644 --- a/dist/core-install.js +++ b/dist/core-install.js @@ -1,3 +1,3 @@ /*! For license information please see core-install.js.LICENSE.txt */ -(()=>{"use strict";var e,t={84891:(e,t,n)=>{var o=n(19755),r=n.n(o),a=n(31352),i=n(78595);const s=((e,t)=>{let n=e.getElementsByTagName("head")[0].getAttribute("data-requesttoken");return{getToken:()=>n,setToken:e=>{n=e,t("csrf-token-update",{token:n})}}})(document,i.j8),d=s.getToken;s.setToken,r().fn.extend({showPassword(e){const t={fn:null,args:{}};t.fn=e;const n=function(e,t){t.val(e.val())},o=function(e,t,o){e.is(":checked")?(n(t,o),o.show(),t.hide()):(n(o,t),o.hide(),t.show())};return this.each((function(){const e=r()(this),a=r()(e.data("typetoggle")),i=function(e){const t=r()(e),n=r()("");return n.attr({type:"text",class:t.attr("class"),style:t.attr("style"),size:t.attr("size"),name:t.attr("name")+"-clone",tabindex:t.attr("tabindex"),autocomplete:"off"}),void 0!==t.attr("placeholder")&&n.attr("placeholder",t.attr("placeholder")),n}(e);i.insertAfter(e),t.fn&&(t.args.input=e,t.args.checkbox=a,t.args.clone=i),a.bind("click",(function(){o(a,e,i)})),e.bind("keyup",(function(){n(e,i)})),i.bind("keyup",(function(){n(i,e),e.trigger("keyup")})),i.bind("blur",(function(){e.trigger("focusout")})),o(a,e,i),i.closest("form").submit((function(e){i.prop("type","password")})),t.fn&&t.fn(t.args)}))}}),n(79366),n(75289),n(56396);var l,c=n(25108);r().prototype.tooltip=(l=r().prototype.tooltip,function(e){try{return l.call(this,e)}catch(t){if(t instanceof TypeError&&"destroy"===e)return void 0===window.TESTING&&c.error("Deprecated call $.tooltip('destroy') has been deprecated and should be removed"),l.call(this,"dispose");if(t instanceof TypeError&&"fixTitle"===e)return void 0===window.TESTING&&c.error("Deprecated call $.tooltip('fixTitle') has been deprecated and should be removed"),l.call(this,"_fixTitle")}}),n(99205),n(38554),window.addEventListener("DOMContentLoaded",(function(){const e=!!r()("#hasSQLite").val();r()("#hasMySQL").val(),r()("#hasPostgreSQL").val(),r()("#hasOracle").val(),r()("#selectDbType").buttonset(),r()("#selectDbType p.info a").button("destroy"),r()("#hasSQLite").val()?(r()("#use_other_db").hide(),r()("#use_oracle_db").hide()):r()("#sqliteInformation").hide(),r()("#adminlogin").change((function(){r()("#adminlogin").val(r().trim(r()("#adminlogin").val()))})),r()("#sqlite").click((function(){r()("#use_other_db").slideUp(250),r()("#use_oracle_db").slideUp(250),r()("#sqliteInformation").show(),r()("#dbname").attr("pattern","[0-9a-zA-Z$_-]+")})),r()("#mysql,#pgsql").click((function(){r()("#use_other_db").slideDown(250),r()("#use_oracle_db").slideUp(250),r()("#sqliteInformation").hide(),r()("#dbname").attr("pattern","[0-9a-zA-Z$_-]+")})),r()("#oci").click((function(){r()("#use_other_db").slideDown(250),r()("#use_oracle_db").show(250),r()("#sqliteInformation").hide(),r()("#dbname").attr("pattern","[0-9a-zA-Z$_-.]+")})),r()("#showAdvanced").click((function(e){e.preventDefault(),r()("#datadirContent").slideToggle(250),r()("#databaseBackend").slideToggle(250),r()("#databaseField").slideToggle(250)})),r()("form").submit((function(){const e=r()(this).serializeArray();r()(".float-spinner").show(250),r()('input[type="submit"]').attr("disabled","disabled").val(r()('input[type="submit"]').data("finishing")),r()("input",this).addClass("ui-state-disabled").attr("disabled","disabled"),r()("#selectDbType").find(".ui-button").length>0&&r()("#selectDbType").buttonset("disable"),r()(".strengthify-wrapper, .tipsy").css("filter","alpha(opacity=30)").css("opacity",.3);const t=r()("