diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2020-06-08 02:46:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-08 02:46:56 +0300 |
commit | d0aaab95f1ef6d8b748b0e8d54f811a366864249 (patch) | |
tree | 86820438b4b56c764912316ebe8152362aa3e2dd /libs/bower_components/jquery-ui/ui/jquery.ui.button.js | |
parent | d10c4e89dc5d1081a3755497c45d366b470eeec7 (diff) |
Switch from bower to npm and update JS libraries (#14082)
* Starting to replace bower with npm: use updated jquery-ui from npm.
* Use jquery from npm./
* Use angular from npm.
* Add more angular libraries.
* Use chroma-js from npm.
* Remove html5shiv, does not appear to be used.
* Use iframe resizer library from npm.
* Add jquery-mousewheel
* Add jquery.dotdotdot from npm.
* Get jquery.scrollto from npm.
* Get jscrollpane from npm.
* Get materialize-css from npm.
* Get mousetrap from npm.
* Remove ngDialog, as it is no longer used.
* Install qrcode.js from npm.
* Get sprintf-js from npm.
* Get visibillityjs from npm.
* Remove bower.json.
* Getting parts of matomo to work w/ new versions of libraries installed by npm.
* Ignore node_modules subfolders in node_modules since we only use npm for frontend dependencies + fix a test.
* Fix button padding.
* Fix series picker checkboxes.
* Fix karma conf.
* Fix CSS in right place.
* Fixing more css/less issues.
* More test fixes.
* Limit selection style fix.
* Fix more tests + materializecss issues.
* Fix a couple more tests.
* Fix annotation styling.
* remove error
* add ng-dialog files
* try to fix some tests
* Fix several UI tests.
* fixing more build issues
* Fix several more tests and issues.
* fixing more tests
* split ui tests into 3 groups
* fix several more issues and tests
* Fix some console warnings on chrome.
* Updating more test files.
* fix some tests
* yet more fixes
* couple more fixes
* another form fix
* Fix some tests.
* update screenshot
* update more expected files
* Fix two more form issues.
* test commit (travis is not fetching submodules for some reason...)
* remove scripts removed in merge
* three travis builds
* split UIIntegrationTest into multiple suites
* lets try this again
* updae several expected screenshots
* fix some more tests
* fix plugin details material select and tabs initiaialization
* update screenshots + css fix
* re-initialize materialize tabs since we load jquery-ui afterwards for datepicker which unsets materialize tabs
* update more screenshots and fix couple more issues
* update more screenshots + tweak to test
* more fixes and screenshot updates
* fix some issues and update more screenshots
* update submodules
* more fixes + more updated screenshots
* more css fixes and test fixes
* couple fixes & updated screenshots
* update screenshots
* fix random failure
* Map old bower_component files to new ones in AssetManager.
* Remove node_modules from PR and ignore node_modules in .gitignore and remove libs/jquery (adding new required libs).
* Update .travis.yml.
* update screenshots
* fixing some more issues
* fix copy pasta
* update screenshots
* fix more modal issues
* Update css & screenshots.
* correct close modal calls
* fixing more issues
* data-target instead of data-activates
* fix more tests
* trigger build that works?
* fix more tests
* update submodule
* debugging travis
* more debugging
* try to fix test
* fix modal no button click in test
* update more screenshots
* couple more test fixes
* some more fixes and updated screenshots
* update screenshots
* apply some review feedback
* Fix modal centering and initial top position.
* apply some more pr feedback
* another pr fix
* update submodule
* remove style
* fix color of checkbox mark
* Fix centering the popover
Note: centering the popover relative to body doesn't work poperly anymore, maybe because of the fixed position of the widget overlay. Using the ui-widget-overlay to position the dialog centered seems to work
* ignore line endings check for node modules
* updates expected UI files
* submodule updates
* use minified file of jquery.browser.js
* updates expected test files
* ensure to hide parent tooltips when row action tooltips are shown
* tweak less for datatable navigation
* style is only useful for dashboard
* update some screenshots
* update submodules
Co-authored-by: sgiehl <stefan@matomo.org>
Diffstat (limited to 'libs/bower_components/jquery-ui/ui/jquery.ui.button.js')
-rw-r--r-- | libs/bower_components/jquery-ui/ui/jquery.ui.button.js | 395 |
1 files changed, 0 insertions, 395 deletions
diff --git a/libs/bower_components/jquery-ui/ui/jquery.ui.button.js b/libs/bower_components/jquery-ui/ui/jquery.ui.button.js deleted file mode 100644 index e8d5544acc..0000000000 --- a/libs/bower_components/jquery-ui/ui/jquery.ui.button.js +++ /dev/null @@ -1,395 +0,0 @@ -/*! - * jQuery UI Button 1.10.4 - * http://jqueryui.com - * - * Copyright 2014 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/button/ - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ -(function( $, undefined ) { - -var lastActive, - baseClasses = "ui-button ui-widget ui-state-default ui-corner-all", - typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only", - formResetHandler = function() { - var form = $( this ); - setTimeout(function() { - form.find( ":ui-button" ).button( "refresh" ); - }, 1 ); - }, - radioGroup = function( radio ) { - var name = radio.name, - form = radio.form, - radios = $( [] ); - if ( name ) { - name = name.replace( /'/g, "\\'" ); - if ( form ) { - radios = $( form ).find( "[name='" + name + "']" ); - } else { - radios = $( "[name='" + name + "']", radio.ownerDocument ) - .filter(function() { - return !this.form; - }); - } - } - return radios; - }; - -$.widget( "ui.button", { - version: "1.10.4", - defaultElement: "<button>", - options: { - disabled: null, - text: true, - label: null, - icons: { - primary: null, - secondary: null - } - }, - _create: function() { - this.element.closest( "form" ) - .unbind( "reset" + this.eventNamespace ) - .bind( "reset" + this.eventNamespace, formResetHandler ); - - if ( typeof this.options.disabled !== "boolean" ) { - this.options.disabled = !!this.element.prop( "disabled" ); - } else { - this.element.prop( "disabled", this.options.disabled ); - } - - this._determineButtonType(); - this.hasTitle = !!this.buttonElement.attr( "title" ); - - var that = this, - options = this.options, - toggleButton = this.type === "checkbox" || this.type === "radio", - activeClass = !toggleButton ? "ui-state-active" : ""; - - if ( options.label === null ) { - options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html()); - } - - this._hoverable( this.buttonElement ); - - this.buttonElement - .addClass( baseClasses ) - .attr( "role", "button" ) - .bind( "mouseenter" + this.eventNamespace, function() { - if ( options.disabled ) { - return; - } - if ( this === lastActive ) { - $( this ).addClass( "ui-state-active" ); - } - }) - .bind( "mouseleave" + this.eventNamespace, function() { - if ( options.disabled ) { - return; - } - $( this ).removeClass( activeClass ); - }) - .bind( "click" + this.eventNamespace, function( event ) { - if ( options.disabled ) { - event.preventDefault(); - event.stopImmediatePropagation(); - } - }); - - // Can't use _focusable() because the element that receives focus - // and the element that gets the ui-state-focus class are different - this._on({ - focus: function() { - this.buttonElement.addClass( "ui-state-focus" ); - }, - blur: function() { - this.buttonElement.removeClass( "ui-state-focus" ); - } - }); - - if ( toggleButton ) { - this.element.bind( "change" + this.eventNamespace, function() { - that.refresh(); - }); - } - - if ( this.type === "checkbox" ) { - this.buttonElement.bind( "click" + this.eventNamespace, function() { - if ( options.disabled ) { - return false; - } - }); - } else if ( this.type === "radio" ) { - this.buttonElement.bind( "click" + this.eventNamespace, function() { - if ( options.disabled ) { - return false; - } - $( this ).addClass( "ui-state-active" ); - that.buttonElement.attr( "aria-pressed", "true" ); - - var radio = that.element[ 0 ]; - radioGroup( radio ) - .not( radio ) - .map(function() { - return $( this ).button( "widget" )[ 0 ]; - }) - .removeClass( "ui-state-active" ) - .attr( "aria-pressed", "false" ); - }); - } else { - this.buttonElement - .bind( "mousedown" + this.eventNamespace, function() { - if ( options.disabled ) { - return false; - } - $( this ).addClass( "ui-state-active" ); - lastActive = this; - that.document.one( "mouseup", function() { - lastActive = null; - }); - }) - .bind( "mouseup" + this.eventNamespace, function() { - if ( options.disabled ) { - return false; - } - $( this ).removeClass( "ui-state-active" ); - }) - .bind( "keydown" + this.eventNamespace, function(event) { - if ( options.disabled ) { - return false; - } - if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) { - $( this ).addClass( "ui-state-active" ); - } - }) - // see #8559, we bind to blur here in case the button element loses - // focus between keydown and keyup, it would be left in an "active" state - .bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() { - $( this ).removeClass( "ui-state-active" ); - }); - - if ( this.buttonElement.is("a") ) { - this.buttonElement.keyup(function(event) { - if ( event.keyCode === $.ui.keyCode.SPACE ) { - // TODO pass through original event correctly (just as 2nd argument doesn't work) - $( this ).click(); - } - }); - } - } - - // TODO: pull out $.Widget's handling for the disabled option into - // $.Widget.prototype._setOptionDisabled so it's easy to proxy and can - // be overridden by individual plugins - this._setOption( "disabled", options.disabled ); - this._resetButton(); - }, - - _determineButtonType: function() { - var ancestor, labelSelector, checked; - - if ( this.element.is("[type=checkbox]") ) { - this.type = "checkbox"; - } else if ( this.element.is("[type=radio]") ) { - this.type = "radio"; - } else if ( this.element.is("input") ) { - this.type = "input"; - } else { - this.type = "button"; - } - - if ( this.type === "checkbox" || this.type === "radio" ) { - // we don't search against the document in case the element - // is disconnected from the DOM - ancestor = this.element.parents().last(); - labelSelector = "label[for='" + this.element.attr("id") + "']"; - this.buttonElement = ancestor.find( labelSelector ); - if ( !this.buttonElement.length ) { - ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings(); - this.buttonElement = ancestor.filter( labelSelector ); - if ( !this.buttonElement.length ) { - this.buttonElement = ancestor.find( labelSelector ); - } - } - this.element.addClass( "ui-helper-hidden-accessible" ); - - checked = this.element.is( ":checked" ); - if ( checked ) { - this.buttonElement.addClass( "ui-state-active" ); - } - this.buttonElement.prop( "aria-pressed", checked ); - } else { - this.buttonElement = this.element; - } - }, - - widget: function() { - return this.buttonElement; - }, - - _destroy: function() { - this.element - .removeClass( "ui-helper-hidden-accessible" ); - this.buttonElement - .removeClass( baseClasses + " ui-state-active " + typeClasses ) - .removeAttr( "role" ) - .removeAttr( "aria-pressed" ) - .html( this.buttonElement.find(".ui-button-text").html() ); - - if ( !this.hasTitle ) { - this.buttonElement.removeAttr( "title" ); - } - }, - - _setOption: function( key, value ) { - this._super( key, value ); - if ( key === "disabled" ) { - this.element.prop( "disabled", !!value ); - if ( value ) { - this.buttonElement.removeClass( "ui-state-focus" ); - } - return; - } - this._resetButton(); - }, - - refresh: function() { - //See #8237 & #8828 - var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" ); - - if ( isDisabled !== this.options.disabled ) { - this._setOption( "disabled", isDisabled ); - } - if ( this.type === "radio" ) { - radioGroup( this.element[0] ).each(function() { - if ( $( this ).is( ":checked" ) ) { - $( this ).button( "widget" ) - .addClass( "ui-state-active" ) - .attr( "aria-pressed", "true" ); - } else { - $( this ).button( "widget" ) - .removeClass( "ui-state-active" ) - .attr( "aria-pressed", "false" ); - } - }); - } else if ( this.type === "checkbox" ) { - if ( this.element.is( ":checked" ) ) { - this.buttonElement - .addClass( "ui-state-active" ) - .attr( "aria-pressed", "true" ); - } else { - this.buttonElement - .removeClass( "ui-state-active" ) - .attr( "aria-pressed", "false" ); - } - } - }, - - _resetButton: function() { - if ( this.type === "input" ) { - if ( this.options.label ) { - this.element.val( this.options.label ); - } - return; - } - var buttonElement = this.buttonElement.removeClass( typeClasses ), - buttonText = $( "<span></span>", this.document[0] ) - .addClass( "ui-button-text" ) - .html( this.options.label ) - .appendTo( buttonElement.empty() ) - .text(), - icons = this.options.icons, - multipleIcons = icons.primary && icons.secondary, - buttonClasses = []; - - if ( icons.primary || icons.secondary ) { - if ( this.options.text ) { - buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) ); - } - - if ( icons.primary ) { - buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" ); - } - - if ( icons.secondary ) { - buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" ); - } - - if ( !this.options.text ) { - buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" ); - - if ( !this.hasTitle ) { - buttonElement.attr( "title", $.trim( buttonText ) ); - } - } - } else { - buttonClasses.push( "ui-button-text-only" ); - } - buttonElement.addClass( buttonClasses.join( " " ) ); - } -}); - -$.widget( "ui.buttonset", { - version: "1.10.4", - options: { - items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)" - }, - - _create: function() { - this.element.addClass( "ui-buttonset" ); - }, - - _init: function() { - this.refresh(); - }, - - _setOption: function( key, value ) { - if ( key === "disabled" ) { - this.buttons.button( "option", key, value ); - } - - this._super( key, value ); - }, - - refresh: function() { - var rtl = this.element.css( "direction" ) === "rtl"; - - this.buttons = this.element.find( this.options.items ) - .filter( ":ui-button" ) - .button( "refresh" ) - .end() - .not( ":ui-button" ) - .button() - .end() - .map(function() { - return $( this ).button( "widget" )[ 0 ]; - }) - .removeClass( "ui-corner-all ui-corner-left ui-corner-right" ) - .filter( ":first" ) - .addClass( rtl ? "ui-corner-right" : "ui-corner-left" ) - .end() - .filter( ":last" ) - .addClass( rtl ? "ui-corner-left" : "ui-corner-right" ) - .end() - .end(); - }, - - _destroy: function() { - this.element.removeClass( "ui-buttonset" ); - this.buttons - .map(function() { - return $( this ).button( "widget" )[ 0 ]; - }) - .removeClass( "ui-corner-left ui-corner-right" ) - .end() - .button( "destroy" ); - } -}); - -}( jQuery ) ); |