diff --git a/app/assets/javascripts/discourse/ember-cli-build.js b/app/assets/javascripts/discourse/ember-cli-build.js index 39387cf7b00..64c40558089 100644 --- a/app/assets/javascripts/discourse/ember-cli-build.js +++ b/app/assets/javascripts/discourse/ember-cli-build.js @@ -104,7 +104,6 @@ module.exports = function (defaults) { // For example: our very specific version of bootstrap-modal. app.import(vendorJs + "bootbox.js"); app.import(vendorJs + "bootstrap-modal.js"); - app.import(vendorJs + "jquery.ui.widget.js"); app.import(vendorJs + "caret_position.js"); app.import("node_modules/ember-source/dist/ember-template-compiler.js", { type: "test", diff --git a/app/assets/javascripts/vendor-common.js b/app/assets/javascripts/vendor-common.js index 9ce43717d4c..c4ea04921b1 100644 --- a/app/assets/javascripts/vendor-common.js +++ b/app/assets/javascripts/vendor-common.js @@ -3,13 +3,11 @@ //= require template_include.js //= require message-bus -//= require jquery.ui.widget.js //= require Markdown.Converter.js //= require bootbox.js //= require popper.js //= require bootstrap-modal.js //= require caret_position -//= require jquery.sortable.js //= require lodash.js //= require itsatrap.js //= require rsvp.js diff --git a/app/assets/javascripts/wizard-vendor.js b/app/assets/javascripts/wizard-vendor.js index 0a72163b2cc..fae10ff315d 100644 --- a/app/assets/javascripts/wizard-vendor.js +++ b/app/assets/javascripts/wizard-vendor.js @@ -1,6 +1,5 @@ //= require ember_jquery //= require template_include.js -//= require jquery.ui.widget.js //= require uppy.js //= require bootstrap-modal.js //= require bootbox.js diff --git a/vendor/assets/javascripts/jquery.sortable.js b/vendor/assets/javascripts/jquery.sortable.js deleted file mode 100644 index 350d172efab..00000000000 --- a/vendor/assets/javascripts/jquery.sortable.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - * HTML5 Sortable jQuery Plugin - * http://farhadi.ir/projects/html5sortable - * - * Copyright 2012, Ali Farhadi - * Released under the MIT license. - */ -(function($) { -var dragging, placeholders = $(); -$.fn.sortable = function(options) { - var method = String(options); - options = $.extend({ - connectWith: false - }, options); - return this.each(function() { - if (/^enable|disable|destroy$/.test(method)) { - var items = $(this).children($(this).data('items')).attr('draggable', method == 'enable'); - if (method == 'destroy') { - items.add(this).removeData('connectWith items') - .off('dragstart.h5s dragend.h5s selectstart.h5s dragover.h5s dragenter.h5s drop.h5s'); - } - return; - } - var isHandle, index, items = $(this).children(options.items); - var placeholder = $('<' + (/^ul|ol$/i.test(this.tagName) ? 'li' : 'div') + ' class="sortable-placeholder">'); - items.find(options.handle).mousedown(function() { - isHandle = true; - }).mouseup(function() { - isHandle = false; - }); - $(this).data('items', options.items) - placeholders = placeholders.add(placeholder); - if (options.connectWith) { - $(options.connectWith).add(this).data('connectWith', options.connectWith); - } - items.attr('draggable', 'true').on('dragstart.h5s', function(e) { - if (options.handle && !isHandle) { - return false; - } - isHandle = false; - var dt = e.originalEvent.dataTransfer; - dt.effectAllowed = 'move'; - dt.setData('Text', 'dummy'); - index = (dragging = $(this)).addClass('sortable-dragging').index(); - }).on('dragend.h5s', function() { - if (!dragging) { - return; - } - dragging.removeClass('sortable-dragging').show(); - placeholders.detach(); - if (index != dragging.index()) { - dragging.parent().trigger('sortupdate', {item: dragging}); - } - dragging = null; - }).not('a[href], img').on('selectstart.h5s', function() { - this.dragDrop && this.dragDrop(); - return false; - }).end().add([this, placeholder]).on('dragover.h5s dragenter.h5s drop.h5s', function(e) { - if (!items.is(dragging) && options.connectWith !== $(dragging).parent().data('connectWith')) { - return true; - } - if (e.type == 'drop') { - e.stopPropagation(); - placeholders.filter(':visible').after(dragging); - dragging.trigger('dragend.h5s'); - return false; - } - e.preventDefault(); - e.originalEvent.dataTransfer.dropEffect = 'move'; - if (items.is(this)) { - if (options.forcePlaceholderSize) { - placeholder.height(dragging.outerHeight()); - } - dragging.hide(); - $(this)[placeholder.index() < $(this).index() ? 'after' : 'before'](placeholder); - placeholders.not(placeholder).detach(); - } else if (!placeholders.is(this) && !$(this).children(options.items).length) { - placeholders.detach(); - $(this).append(placeholder); - } - return false; - }); - }); -}; -})(jQuery); diff --git a/vendor/assets/javascripts/jquery.ui.widget.js b/vendor/assets/javascripts/jquery.ui.widget.js deleted file mode 100644 index 69096aaa35e..00000000000 --- a/vendor/assets/javascripts/jquery.ui.widget.js +++ /dev/null @@ -1,808 +0,0 @@ -/*! jQuery UI - v1.12.1+0b7246b6eeadfa9e2696e22f3230f6452f8129dc - 2020-02-20 - * http://jqueryui.com - * Includes: widget.js - * Copyright jQuery Foundation and other contributors; Licensed MIT */ - -/* global define, require */ -/* eslint-disable no-param-reassign, new-cap, jsdoc/require-jsdoc */ - -(function (factory) { - 'use strict'; - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['jquery'], factory); - } else if (typeof exports === 'object') { - // Node/CommonJS - factory(require('jquery')); - } else { - // Browser globals - factory(window.jQuery); - } -})(function ($) { - ('use strict'); - - $.ui = $.ui || {}; - - $.ui.version = '1.12.1'; - - /*! - * jQuery UI Widget 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ - - //>>label: Widget - //>>group: Core - //>>description: Provides a factory for creating stateful widgets with a common API. - //>>docs: http://api.jqueryui.com/jQuery.widget/ - //>>demos: http://jqueryui.com/widget/ - - // Support: jQuery 1.9.x or older - // $.expr[ ":" ] is deprecated. - if (!$.expr.pseudos) { - $.expr.pseudos = $.expr[':']; - } - - // Support: jQuery 1.11.x or older - // $.unique has been renamed to $.uniqueSort - if (!$.uniqueSort) { - $.uniqueSort = $.unique; - } - - var widgetUuid = 0; - var widgetHasOwnProperty = Array.prototype.hasOwnProperty; - var widgetSlice = Array.prototype.slice; - - $.cleanData = (function (orig) { - return function (elems) { - var events, elem, i; - // eslint-disable-next-line eqeqeq - for (i = 0; (elem = elems[i]) != null; i++) { - // Only trigger remove when necessary to save time - events = $._data(elem, 'events'); - if (events && events.remove) { - $(elem).triggerHandler('remove'); - } - } - orig(elems); - }; - })($.cleanData); - - $.widget = function (name, base, prototype) { - var existingConstructor, constructor, basePrototype; - - // ProxiedPrototype allows the provided prototype to remain unmodified - // so that it can be used as a mixin for multiple widgets (#8876) - var proxiedPrototype = {}; - - var namespace = name.split('.')[0]; - name = name.split('.')[1]; - var fullName = namespace + '-' + name; - - if (!prototype) { - prototype = base; - base = $.Widget; - } - - if ($.isArray(prototype)) { - prototype = $.extend.apply(null, [{}].concat(prototype)); - } - - // Create selector for plugin - $.expr.pseudos[fullName.toLowerCase()] = function (elem) { - return !!$.data(elem, fullName); - }; - - $[namespace] = $[namespace] || {}; - existingConstructor = $[namespace][name]; - constructor = $[namespace][name] = function (options, element) { - // Allow instantiation without "new" keyword - if (!this._createWidget) { - return new constructor(options, element); - } - - // Allow instantiation without initializing for simple inheritance - // must use "new" keyword (the code above always passes args) - if (arguments.length) { - this._createWidget(options, element); - } - }; - - // Extend with the existing constructor to carry over any static properties - $.extend(constructor, existingConstructor, { - version: prototype.version, - - // Copy the object used to create the prototype in case we need to - // redefine the widget later - _proto: $.extend({}, prototype), - - // Track widgets that inherit from this widget in case this widget is - // redefined after a widget inherits from it - _childConstructors: [] - }); - - basePrototype = new base(); - - // We need to make the options hash a property directly on the new instance - // otherwise we'll modify the options hash on the prototype that we're - // inheriting from - basePrototype.options = $.widget.extend({}, basePrototype.options); - $.each(prototype, function (prop, value) { - if (!$.isFunction(value)) { - proxiedPrototype[prop] = value; - return; - } - proxiedPrototype[prop] = (function () { - function _super() { - return base.prototype[prop].apply(this, arguments); - } - - function _superApply(args) { - return base.prototype[prop].apply(this, args); - } - - return function () { - var __super = this._super; - var __superApply = this._superApply; - var returnValue; - - this._super = _super; - this._superApply = _superApply; - - returnValue = value.apply(this, arguments); - - this._super = __super; - this._superApply = __superApply; - - return returnValue; - }; - })(); - }); - constructor.prototype = $.widget.extend( - basePrototype, - { - // TODO: remove support for widgetEventPrefix - // always use the name + a colon as the prefix, e.g., draggable:start - // don't prefix for widgets that aren't DOM-based - widgetEventPrefix: existingConstructor - ? basePrototype.widgetEventPrefix || name - : name - }, - proxiedPrototype, - { - constructor: constructor, - namespace: namespace, - widgetName: name, - widgetFullName: fullName - } - ); - - // If this widget is being redefined then we need to find all widgets that - // are inheriting from it and redefine all of them so that they inherit from - // the new version of this widget. We're essentially trying to replace one - // level in the prototype chain. - if (existingConstructor) { - $.each(existingConstructor._childConstructors, function (i, child) { - var childPrototype = child.prototype; - - // Redefine the child widget using the same prototype that was - // originally used, but inherit from the new version of the base - $.widget( - childPrototype.namespace + '.' + childPrototype.widgetName, - constructor, - child._proto - ); - }); - - // Remove the list of existing child constructors from the old constructor - // so the old child constructors can be garbage collected - delete existingConstructor._childConstructors; - } else { - base._childConstructors.push(constructor); - } - - $.widget.bridge(name, constructor); - - return constructor; - }; - - $.widget.extend = function (target) { - var input = widgetSlice.call(arguments, 1); - var inputIndex = 0; - var inputLength = input.length; - var key; - var value; - - for (; inputIndex < inputLength; inputIndex++) { - for (key in input[inputIndex]) { - value = input[inputIndex][key]; - if ( - widgetHasOwnProperty.call(input[inputIndex], key) && - value !== undefined - ) { - // Clone objects - if ($.isPlainObject(value)) { - target[key] = $.isPlainObject(target[key]) - ? $.widget.extend({}, target[key], value) - : // Don't extend strings, arrays, etc. with objects - $.widget.extend({}, value); - - // Copy everything else by reference - } else { - target[key] = value; - } - } - } - } - return target; - }; - - $.widget.bridge = function (name, object) { - var fullName = object.prototype.widgetFullName || name; - $.fn[name] = function (options) { - var isMethodCall = typeof options === 'string'; - var args = widgetSlice.call(arguments, 1); - var returnValue = this; - - if (isMethodCall) { - // If this is an empty collection, we need to have the instance method - // return undefined instead of the jQuery instance - if (!this.length && options === 'instance') { - returnValue = undefined; - } else { - this.each(function () { - var methodValue; - var instance = $.data(this, fullName); - - if (options === 'instance') { - returnValue = instance; - return false; - } - - if (!instance) { - return $.error( - 'cannot call methods on ' + - name + - ' prior to initialization; ' + - "attempted to call method '" + - options + - "'" - ); - } - - if (!$.isFunction(instance[options]) || options.charAt(0) === '_') { - return $.error( - "no such method '" + - options + - "' for " + - name + - ' widget instance' - ); - } - - methodValue = instance[options].apply(instance, args); - - if (methodValue !== instance && methodValue !== undefined) { - returnValue = - methodValue && methodValue.jquery - ? returnValue.pushStack(methodValue.get()) - : methodValue; - return false; - } - }); - } - } else { - // Allow multiple hashes to be passed on init - if (args.length) { - options = $.widget.extend.apply(null, [options].concat(args)); - } - - this.each(function () { - var instance = $.data(this, fullName); - if (instance) { - instance.option(options || {}); - if (instance._init) { - instance._init(); - } - } else { - $.data(this, fullName, new object(options, this)); - } - }); - } - - return returnValue; - }; - }; - - $.Widget = function (/* options, element */) {}; - $.Widget._childConstructors = []; - - $.Widget.prototype = { - widgetName: 'widget', - widgetEventPrefix: '', - defaultElement: '