├── .gitignore ├── bower_components ├── jasmine-jquery │ ├── spec │ │ └── fixtures │ │ │ ├── json │ │ │ └── jasmine_json_test.json │ │ │ ├── real_non_mocked_fixture_style.css │ │ │ ├── real_non_mocked_fixture.html │ │ │ ├── fixture_with_javascript_block.html │ │ │ ├── javascripts │ │ │ ├── jasmine_javascript_click.js │ │ │ └── jasmine_javascript_hover.js │ │ │ ├── fixture_with_checkbox_with_checked.html │ │ │ └── fixture_with_javascript.html │ ├── bower.json │ ├── .bower.json │ ├── package.json │ ├── LICENSE │ ├── Gruntfile.js │ └── CONTRIBUTING.md └── jquery │ ├── src │ ├── var │ │ ├── arr.js │ │ ├── rnotwhite.js │ │ ├── document.js │ │ ├── getProto.js │ │ ├── push.js │ │ ├── slice.js │ │ ├── class2type.js │ │ ├── concat.js │ │ ├── indexOf.js │ │ ├── pnum.js │ │ ├── fnToString.js │ │ ├── toString.js │ │ ├── documentElement.js │ │ ├── hasOwn.js │ │ ├── support.js │ │ ├── ObjectFunctionString.js │ │ └── rcssNum.js │ ├── selector.js │ ├── ajax │ │ ├── var │ │ │ ├── rquery.js │ │ │ ├── location.js │ │ │ └── nonce.js │ │ ├── parseXML.js │ │ ├── script.js │ │ ├── load.js │ │ ├── jsonp.js │ │ └── xhr.js │ ├── css │ │ ├── var │ │ │ ├── rmargin.js │ │ │ ├── cssExpand.js │ │ │ ├── rnumnonpx.js │ │ │ ├── getStyles.js │ │ │ ├── swap.js │ │ │ └── isHiddenWithinTree.js │ │ ├── hiddenVisibleSelectors.js │ │ ├── addGetHookIf.js │ │ ├── curCSS.js │ │ ├── adjustCSS.js │ │ ├── support.js │ │ └── showHide.js │ ├── data │ │ ├── var │ │ │ ├── dataPriv.js │ │ │ ├── dataUser.js │ │ │ └── acceptData.js │ │ └── Data.js │ ├── manipulation │ │ ├── var │ │ │ ├── rcheckableType.js │ │ │ ├── rscriptType.js │ │ │ └── rtagName.js │ │ ├── _evalUrl.js │ │ ├── setGlobalEval.js │ │ ├── getAll.js │ │ ├── wrapMap.js │ │ ├── support.js │ │ └── buildFragment.js │ ├── core │ │ ├── var │ │ │ └── rsingleTag.js │ │ ├── readyException.js │ │ ├── DOMEval.js │ │ ├── support.js │ │ ├── access.js │ │ ├── parseHTML.js │ │ ├── ready.js │ │ ├── ready-no-deferred.js │ │ └── init.js │ ├── traversing │ │ ├── var │ │ │ ├── rneedsContext.js │ │ │ ├── siblings.js │ │ │ └── dir.js │ │ └── findFilter.js │ ├── event │ │ ├── support.js │ │ ├── ajax.js │ │ ├── alias.js │ │ ├── focusin.js │ │ └── trigger.js │ ├── attributes.js │ ├── effects │ │ ├── animatedSelector.js │ │ └── Tween.js │ ├── .eslintrc │ ├── selector-sizzle.js │ ├── deprecated.js │ ├── deferred │ │ └── exceptionHook.js │ ├── queue │ │ └── delay.js │ ├── jquery.js │ ├── exports │ │ ├── global.js │ │ └── amd.js │ ├── attributes │ │ ├── support.js │ │ ├── prop.js │ │ ├── attr.js │ │ ├── val.js │ │ └── classes.js │ ├── wrap.js │ ├── dimensions.js │ ├── serialize.js │ ├── queue.js │ ├── data.js │ ├── traversing.js │ ├── callbacks.js │ ├── offset.js │ ├── selector-native.js │ ├── deferred.js │ └── css.js │ ├── bower.json │ ├── .bower.json │ ├── LICENSE.txt │ ├── external │ └── sizzle │ │ └── LICENSE.txt │ ├── README.md │ └── AUTHORS.txt ├── test └── unit │ └── PushNotificationSpec.js ├── package.json ├── LICENSE ├── push_notification.min.js ├── README.ja.md ├── README.md ├── karma.conf.js ├── push_notification.js.coffee └── push_notification.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /bower_components/jasmine-jquery/spec/fixtures/json/jasmine_json_test.json: -------------------------------------------------------------------------------- 1 | [1,2,3] 2 | -------------------------------------------------------------------------------- /bower_components/jasmine-jquery/spec/fixtures/real_non_mocked_fixture_style.css: -------------------------------------------------------------------------------- 1 | body { background: red; } -------------------------------------------------------------------------------- /bower_components/jquery/src/var/arr.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return []; 5 | } ); 6 | -------------------------------------------------------------------------------- /bower_components/jasmine-jquery/spec/fixtures/real_non_mocked_fixture.html: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /bower_components/jquery/src/selector.js: -------------------------------------------------------------------------------- 1 | define( [ "./selector-sizzle" ], function() { 2 | "use strict"; 3 | } ); 4 | -------------------------------------------------------------------------------- /bower_components/jquery/src/ajax/var/rquery.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return ( /\?/ ); 5 | } ); 6 | -------------------------------------------------------------------------------- /bower_components/jquery/src/var/rnotwhite.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return ( /\S+/g ); 5 | } ); 6 | -------------------------------------------------------------------------------- /bower_components/jquery/src/css/var/rmargin.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return ( /^margin/ ); 5 | } ); 6 | -------------------------------------------------------------------------------- /bower_components/jquery/src/var/document.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return window.document; 5 | } ); 6 | -------------------------------------------------------------------------------- /bower_components/jquery/src/ajax/var/location.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return window.location; 5 | } ); 6 | -------------------------------------------------------------------------------- /bower_components/jquery/src/var/getProto.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return Object.getPrototypeOf; 5 | } ); 6 | -------------------------------------------------------------------------------- /bower_components/jquery/src/var/push.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./arr" 3 | ], function( arr ) { 4 | "use strict"; 5 | 6 | return arr.push; 7 | } ); 8 | -------------------------------------------------------------------------------- /bower_components/jquery/src/var/slice.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./arr" 3 | ], function( arr ) { 4 | "use strict"; 5 | 6 | return arr.slice; 7 | } ); 8 | -------------------------------------------------------------------------------- /bower_components/jquery/src/var/class2type.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | // [[Class]] -> type pairs 5 | return {}; 6 | } ); 7 | -------------------------------------------------------------------------------- /bower_components/jquery/src/var/concat.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./arr" 3 | ], function( arr ) { 4 | "use strict"; 5 | 6 | return arr.concat; 7 | } ); 8 | -------------------------------------------------------------------------------- /bower_components/jquery/src/var/indexOf.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./arr" 3 | ], function( arr ) { 4 | "use strict"; 5 | 6 | return arr.indexOf; 7 | } ); 8 | -------------------------------------------------------------------------------- /bower_components/jasmine-jquery/spec/fixtures/fixture_with_javascript_block.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /bower_components/jquery/src/css/var/cssExpand.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return [ "Top", "Right", "Bottom", "Left" ]; 5 | } ); 6 | -------------------------------------------------------------------------------- /bower_components/jquery/src/data/var/dataPriv.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../Data" 3 | ], function( Data ) { 4 | "use strict"; 5 | 6 | return new Data(); 7 | } ); 8 | -------------------------------------------------------------------------------- /bower_components/jquery/src/data/var/dataUser.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../Data" 3 | ], function( Data ) { 4 | "use strict"; 5 | 6 | return new Data(); 7 | } ); 8 | -------------------------------------------------------------------------------- /bower_components/jquery/src/manipulation/var/rcheckableType.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return ( /^(?:checkbox|radio)$/i ); 5 | } ); 6 | -------------------------------------------------------------------------------- /bower_components/jquery/src/manipulation/var/rscriptType.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return ( /^$|\/(?:java|ecma)script/i ); 5 | } ); 6 | -------------------------------------------------------------------------------- /bower_components/jquery/src/var/pnum.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 5 | } ); 6 | -------------------------------------------------------------------------------- /bower_components/jasmine-jquery/spec/fixtures/javascripts/jasmine_javascript_click.js: -------------------------------------------------------------------------------- 1 | $(function (){ $('#anchor_01').click(function(){ $(this).addClass('foo'); }) }); -------------------------------------------------------------------------------- /bower_components/jquery/src/ajax/var/nonce.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../../core" 3 | ], function( jQuery ) { 4 | "use strict"; 5 | 6 | return jQuery.now(); 7 | } ); 8 | -------------------------------------------------------------------------------- /bower_components/jquery/src/manipulation/var/rtagName.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i ); 5 | } ); 6 | -------------------------------------------------------------------------------- /bower_components/jquery/src/var/fnToString.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./hasOwn" 3 | ], function( hasOwn ) { 4 | "use strict"; 5 | 6 | return hasOwn.toString; 7 | } ); 8 | -------------------------------------------------------------------------------- /bower_components/jasmine-jquery/spec/fixtures/javascripts/jasmine_javascript_hover.js: -------------------------------------------------------------------------------- 1 | $(function (){ $('#anchor_01').on('hover', function(){ $(this).addClass('bar'); }) }); 2 | -------------------------------------------------------------------------------- /bower_components/jquery/src/var/toString.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./class2type" 3 | ], function( class2type ) { 4 | "use strict"; 5 | 6 | return class2type.toString; 7 | } ); 8 | -------------------------------------------------------------------------------- /bower_components/jquery/src/var/documentElement.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./document" 3 | ], function( document ) { 4 | "use strict"; 5 | 6 | return document.documentElement; 7 | } ); 8 | -------------------------------------------------------------------------------- /bower_components/jquery/src/var/hasOwn.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./class2type" 3 | ], function( class2type ) { 4 | "use strict"; 5 | 6 | return class2type.hasOwnProperty; 7 | } ); 8 | -------------------------------------------------------------------------------- /bower_components/jquery/src/var/support.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | // All support tests are defined in their respective modules. 5 | return {}; 6 | } ); 7 | -------------------------------------------------------------------------------- /bower_components/jquery/src/var/ObjectFunctionString.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./fnToString" 3 | ], function( fnToString ) { 4 | "use strict"; 5 | 6 | return fnToString.call( Object ); 7 | } ); 8 | -------------------------------------------------------------------------------- /bower_components/jquery/src/css/var/rnumnonpx.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../../var/pnum" 3 | ], function( pnum ) { 4 | "use strict"; 5 | 6 | return new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 7 | } ); 8 | -------------------------------------------------------------------------------- /bower_components/jquery/src/core/var/rsingleTag.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | // Match a standalone tag 5 | return ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); 6 | } ); 7 | -------------------------------------------------------------------------------- /bower_components/jquery/src/traversing/var/rneedsContext.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../../core", 3 | "../../selector" 4 | ], function( jQuery ) { 5 | "use strict"; 6 | 7 | return jQuery.expr.match.needsContext; 8 | } ); 9 | -------------------------------------------------------------------------------- /bower_components/jquery/src/var/rcssNum.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../var/pnum" 3 | ], function( pnum ) { 4 | 5 | "use strict"; 6 | 7 | return new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 8 | 9 | } ); 10 | -------------------------------------------------------------------------------- /bower_components/jquery/src/event/support.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../var/support" 3 | ], function( support ) { 4 | 5 | "use strict"; 6 | 7 | support.focusin = "onfocusin" in window; 8 | 9 | return support; 10 | 11 | } ); 12 | -------------------------------------------------------------------------------- /bower_components/jasmine-jquery/spec/fixtures/fixture_with_checkbox_with_checked.html: -------------------------------------------------------------------------------- 1 |
2 | 6 |
-------------------------------------------------------------------------------- /bower_components/jasmine-jquery/spec/fixtures/fixture_with_javascript.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /bower_components/jquery/src/core/readyException.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | "use strict"; 6 | 7 | jQuery.readyException = function( error ) { 8 | window.setTimeout( function() { 9 | throw error; 10 | } ); 11 | }; 12 | 13 | } ); 14 | -------------------------------------------------------------------------------- /bower_components/jquery/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ] 14 | } -------------------------------------------------------------------------------- /bower_components/jquery/src/attributes.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./core", 3 | "./attributes/attr", 4 | "./attributes/prop", 5 | "./attributes/classes", 6 | "./attributes/val" 7 | ], function( jQuery ) { 8 | 9 | "use strict"; 10 | 11 | // Return jQuery for attributes-only inclusion 12 | return jQuery; 13 | } ); 14 | -------------------------------------------------------------------------------- /bower_components/jasmine-jquery/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jasmine-jquery", 3 | "main": "lib/jasmine-jquery.js", 4 | "ignore": [ 5 | "test", 6 | "vendor", 7 | ".*", 8 | "HISTORY.md", 9 | "SpecRunner.html" 10 | ], 11 | "dependencies": { 12 | "jasmine": ">=2", 13 | "jquery": ">=2" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /bower_components/jquery/src/traversing/var/siblings.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | 3 | "use strict"; 4 | 5 | return function( n, elem ) { 6 | var matched = []; 7 | 8 | for ( ; n; n = n.nextSibling ) { 9 | if ( n.nodeType === 1 && n !== elem ) { 10 | matched.push( n ); 11 | } 12 | } 13 | 14 | return matched; 15 | }; 16 | 17 | } ); 18 | -------------------------------------------------------------------------------- /bower_components/jquery/src/effects/animatedSelector.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../selector", 4 | "../effects" 5 | ], function( jQuery ) { 6 | 7 | "use strict"; 8 | 9 | jQuery.expr.pseudos.animated = function( elem ) { 10 | return jQuery.grep( jQuery.timers, function( fn ) { 11 | return elem === fn.elem; 12 | } ).length; 13 | }; 14 | 15 | } ); 16 | -------------------------------------------------------------------------------- /bower_components/jquery/src/core/DOMEval.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../var/document" 3 | ], function( document ) { 4 | "use strict"; 5 | 6 | function DOMEval( code, doc ) { 7 | doc = doc || document; 8 | 9 | var script = doc.createElement( "script" ); 10 | 11 | script.text = code; 12 | doc.head.appendChild( script ).parentNode.removeChild( script ); 13 | } 14 | 15 | return DOMEval; 16 | } ); 17 | -------------------------------------------------------------------------------- /bower_components/jquery/src/css/hiddenVisibleSelectors.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../selector" 4 | ], function( jQuery ) { 5 | 6 | "use strict"; 7 | 8 | jQuery.expr.pseudos.hidden = function( elem ) { 9 | return !jQuery.expr.pseudos.visible( elem ); 10 | }; 11 | jQuery.expr.pseudos.visible = function( elem ) { 12 | return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); 13 | }; 14 | 15 | } ); 16 | -------------------------------------------------------------------------------- /bower_components/jquery/src/data/var/acceptData.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | 3 | "use strict"; 4 | 5 | /** 6 | * Determines whether an object can have data 7 | */ 8 | return function( owner ) { 9 | 10 | // Accepts only: 11 | // - Node 12 | // - Node.ELEMENT_NODE 13 | // - Node.DOCUMENT_NODE 14 | // - Object 15 | // - Any 16 | return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 17 | }; 18 | 19 | } ); 20 | -------------------------------------------------------------------------------- /bower_components/jquery/src/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | // Support: IE <=9 only, Android <=4.0 only 3 | // The above browsers are failing a lot of tests in the ES5 4 | // test suite at http://test262.ecmascript.org. 5 | "parserOptions": { 6 | "ecmaVersion": 3 7 | }, 8 | "globals": { 9 | "window": true, 10 | "jQuery": true, 11 | "define": true, 12 | "module": true, 13 | "noGlobal": true 14 | }, 15 | "rules": { 16 | "strict": ["error", "function"] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /bower_components/jquery/src/event/ajax.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../event" 4 | ], function( jQuery ) { 5 | 6 | "use strict"; 7 | 8 | // Attach a bunch of functions for handling common AJAX events 9 | jQuery.each( [ 10 | "ajaxStart", 11 | "ajaxStop", 12 | "ajaxComplete", 13 | "ajaxError", 14 | "ajaxSuccess", 15 | "ajaxSend" 16 | ], function( i, type ) { 17 | jQuery.fn[ type ] = function( fn ) { 18 | return this.on( type, fn ); 19 | }; 20 | } ); 21 | 22 | } ); 23 | -------------------------------------------------------------------------------- /bower_components/jquery/src/manipulation/_evalUrl.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../ajax" 3 | ], function( jQuery ) { 4 | 5 | "use strict"; 6 | 7 | jQuery._evalUrl = function( url ) { 8 | return jQuery.ajax( { 9 | url: url, 10 | 11 | // Make this explicit, since user can override this through ajaxSetup (#11264) 12 | type: "GET", 13 | dataType: "script", 14 | cache: true, 15 | async: false, 16 | global: false, 17 | "throws": true 18 | } ); 19 | }; 20 | 21 | return jQuery._evalUrl; 22 | 23 | } ); 24 | -------------------------------------------------------------------------------- /bower_components/jquery/src/traversing/var/dir.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../../core" 3 | ], function( jQuery ) { 4 | 5 | "use strict"; 6 | 7 | return function( elem, dir, until ) { 8 | var matched = [], 9 | truncate = until !== undefined; 10 | 11 | while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 12 | if ( elem.nodeType === 1 ) { 13 | if ( truncate && jQuery( elem ).is( until ) ) { 14 | break; 15 | } 16 | matched.push( elem ); 17 | } 18 | } 19 | return matched; 20 | }; 21 | 22 | } ); 23 | -------------------------------------------------------------------------------- /bower_components/jquery/src/css/var/getStyles.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | "use strict"; 3 | 4 | return function( elem ) { 5 | 6 | // Support: IE <=11 only, Firefox <=30 (#15098, #14150) 7 | // IE throws on elements created in popups 8 | // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 9 | var view = elem.ownerDocument.defaultView; 10 | 11 | if ( !view || !view.opener ) { 12 | view = window; 13 | } 14 | 15 | return view.getComputedStyle( elem ); 16 | }; 17 | } ); 18 | -------------------------------------------------------------------------------- /bower_components/jquery/src/manipulation/setGlobalEval.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../data/var/dataPriv" 3 | ], function( dataPriv ) { 4 | 5 | "use strict"; 6 | 7 | // Mark scripts as having already been evaluated 8 | function setGlobalEval( elems, refElements ) { 9 | var i = 0, 10 | l = elems.length; 11 | 12 | for ( ; i < l; i++ ) { 13 | dataPriv.set( 14 | elems[ i ], 15 | "globalEval", 16 | !refElements || dataPriv.get( refElements[ i ], "globalEval" ) 17 | ); 18 | } 19 | } 20 | 21 | return setGlobalEval; 22 | } ); 23 | -------------------------------------------------------------------------------- /bower_components/jquery/src/selector-sizzle.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./core", 3 | "../external/sizzle/dist/sizzle" 4 | ], function( jQuery, Sizzle ) { 5 | 6 | "use strict"; 7 | 8 | jQuery.find = Sizzle; 9 | jQuery.expr = Sizzle.selectors; 10 | 11 | // Deprecated 12 | jQuery.expr[ ":" ] = jQuery.expr.pseudos; 13 | jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; 14 | jQuery.text = Sizzle.getText; 15 | jQuery.isXMLDoc = Sizzle.isXML; 16 | jQuery.contains = Sizzle.contains; 17 | jQuery.escapeSelector = Sizzle.escape; 18 | 19 | } ); 20 | -------------------------------------------------------------------------------- /test/unit/PushNotificationSpec.js: -------------------------------------------------------------------------------- 1 | describe('instantiation', function() { 2 | 3 | 'use strict'; 4 | 5 | it('should create a new Notify instance', function() { 6 | var notification = window.$.notify("body"); 7 | expect(notification).toBeDefined(); 8 | }); 9 | 10 | it('should throw an exception', function(){ 11 | expect(function(){ window.$.notify() }).toThrow(); 12 | }); 13 | 14 | it('should throw an exception', function(){ 15 | expect(function(){ window.$.notify(1) }).toThrow(); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /bower_components/jquery/src/css/var/swap.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | 3 | "use strict"; 4 | 5 | // A method for quickly swapping in/out CSS properties to get correct calculations. 6 | return function( elem, options, callback, args ) { 7 | var ret, name, 8 | old = {}; 9 | 10 | // Remember the old values, and insert the new ones 11 | for ( name in options ) { 12 | old[ name ] = elem.style[ name ]; 13 | elem.style[ name ] = options[ name ]; 14 | } 15 | 16 | ret = callback.apply( elem, args || [] ); 17 | 18 | // Revert the old values 19 | for ( name in options ) { 20 | elem.style[ name ] = old[ name ]; 21 | } 22 | 23 | return ret; 24 | }; 25 | 26 | } ); 27 | -------------------------------------------------------------------------------- /bower_components/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "3.1.0", 16 | "_release": "3.1.0", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "3.1.0", 20 | "commit": "6f02bc382c0529d3b4f68f6b2ad21876642dbbfe" 21 | }, 22 | "_source": "https://github.com/jquery/jquery-dist.git", 23 | "_target": "^3.1.0", 24 | "_originalSource": "jquery", 25 | "_direct": true 26 | } -------------------------------------------------------------------------------- /bower_components/jquery/src/css/addGetHookIf.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | 3 | "use strict"; 4 | 5 | function addGetHookIf( conditionFn, hookFn ) { 6 | 7 | // Define the hook, we'll check on the first run if it's really needed. 8 | return { 9 | get: function() { 10 | if ( conditionFn() ) { 11 | 12 | // Hook not needed (or it's not possible to use it due 13 | // to missing dependency), remove it. 14 | delete this.get; 15 | return; 16 | } 17 | 18 | // Hook needed; redefine it so that the support test is not executed again. 19 | return ( this.get = hookFn ).apply( this, arguments ); 20 | } 21 | }; 22 | } 23 | 24 | return addGetHookIf; 25 | 26 | } ); 27 | -------------------------------------------------------------------------------- /bower_components/jquery/src/manipulation/getAll.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | "use strict"; 6 | 7 | function getAll( context, tag ) { 8 | 9 | // Support: IE <=9 - 11 only 10 | // Use typeof to avoid zero-argument method invocation on host objects (#15151) 11 | var ret = typeof context.getElementsByTagName !== "undefined" ? 12 | context.getElementsByTagName( tag || "*" ) : 13 | typeof context.querySelectorAll !== "undefined" ? 14 | context.querySelectorAll( tag || "*" ) : 15 | []; 16 | 17 | return tag === undefined || tag && jQuery.nodeName( context, tag ) ? 18 | jQuery.merge( [ context ], ret ) : 19 | ret; 20 | } 21 | 22 | return getAll; 23 | } ); 24 | -------------------------------------------------------------------------------- /bower_components/jquery/src/ajax/parseXML.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | "use strict"; 6 | 7 | // Cross-browser xml parsing 8 | jQuery.parseXML = function( data ) { 9 | var xml; 10 | if ( !data || typeof data !== "string" ) { 11 | return null; 12 | } 13 | 14 | // Support: IE 9 - 11 only 15 | // IE throws on parseFromString with invalid input. 16 | try { 17 | xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 18 | } catch ( e ) { 19 | xml = undefined; 20 | } 21 | 22 | if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { 23 | jQuery.error( "Invalid XML: " + data ); 24 | } 25 | return xml; 26 | }; 27 | 28 | return jQuery.parseXML; 29 | 30 | } ); 31 | -------------------------------------------------------------------------------- /bower_components/jasmine-jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jasmine-jquery", 3 | "main": "lib/jasmine-jquery.js", 4 | "ignore": [ 5 | "test", 6 | "vendor", 7 | ".*", 8 | "HISTORY.md", 9 | "SpecRunner.html" 10 | ], 11 | "dependencies": { 12 | "jasmine": ">=2", 13 | "jquery": ">=2" 14 | }, 15 | "homepage": "https://github.com/velesin/jasmine-jquery", 16 | "version": "2.1.1", 17 | "_release": "2.1.1", 18 | "_resolution": { 19 | "type": "version", 20 | "tag": "2.1.1", 21 | "commit": "fdd234f58d4997ec13400ba4f070e8a803f6ecbe" 22 | }, 23 | "_source": "https://github.com/velesin/jasmine-jquery.git", 24 | "_target": "^2.1.1", 25 | "_originalSource": "jasmine-jquery", 26 | "_direct": true 27 | } -------------------------------------------------------------------------------- /bower_components/jquery/src/core/support.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../var/document", 3 | "../var/support" 4 | ], function( document, support ) { 5 | 6 | "use strict"; 7 | 8 | // Support: Safari 8 only 9 | // In Safari 8 documents created via document.implementation.createHTMLDocument 10 | // collapse sibling forms: the second one becomes a child of the first one. 11 | // Because of that, this security measure has to be disabled in Safari 8. 12 | // https://bugs.webkit.org/show_bug.cgi?id=137337 13 | support.createHTMLDocument = ( function() { 14 | var body = document.implementation.createHTMLDocument( "" ).body; 15 | body.innerHTML = "
"; 16 | return body.childNodes.length === 2; 17 | } )(); 18 | 19 | return support; 20 | } ); 21 | -------------------------------------------------------------------------------- /bower_components/jquery/src/deprecated.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./core" 3 | ], function( jQuery ) { 4 | 5 | "use strict"; 6 | 7 | jQuery.fn.extend( { 8 | 9 | bind: function( types, data, fn ) { 10 | return this.on( types, null, data, fn ); 11 | }, 12 | unbind: function( types, fn ) { 13 | return this.off( types, null, fn ); 14 | }, 15 | 16 | delegate: function( selector, types, data, fn ) { 17 | return this.on( types, selector, data, fn ); 18 | }, 19 | undelegate: function( selector, types, fn ) { 20 | 21 | // ( namespace ) or ( selector, types [, fn] ) 22 | return arguments.length === 1 ? 23 | this.off( selector, "**" ) : 24 | this.off( types, selector || "**", fn ); 25 | } 26 | } ); 27 | 28 | jQuery.parseJSON = JSON.parse; 29 | 30 | } ); 31 | -------------------------------------------------------------------------------- /bower_components/jquery/src/deferred/exceptionHook.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../deferred" 4 | ], function( jQuery ) { 5 | 6 | "use strict"; 7 | 8 | // These usually indicate a programmer mistake during development, 9 | // warn about them ASAP rather than swallowing them by default. 10 | var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 11 | 12 | jQuery.Deferred.exceptionHook = function( error, stack ) { 13 | 14 | // Support: IE 8 - 9 only 15 | // Console exists when dev tools are open, which can happen at any time 16 | if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { 17 | window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); 18 | } 19 | }; 20 | 21 | } ); 22 | -------------------------------------------------------------------------------- /bower_components/jquery/src/queue/delay.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../queue", 4 | "../effects" // Delay is optional because of this dependency 5 | ], function( jQuery ) { 6 | 7 | "use strict"; 8 | 9 | // Based off of the plugin by Clint Helfers, with permission. 10 | // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ 11 | jQuery.fn.delay = function( time, type ) { 12 | time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 13 | type = type || "fx"; 14 | 15 | return this.queue( type, function( next, hooks ) { 16 | var timeout = window.setTimeout( next, time ); 17 | hooks.stop = function() { 18 | window.clearTimeout( timeout ); 19 | }; 20 | } ); 21 | }; 22 | 23 | return jQuery.fn.delay; 24 | } ); 25 | -------------------------------------------------------------------------------- /bower_components/jquery/src/event/alias.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | 4 | "../event", 5 | "./trigger" 6 | ], function( jQuery ) { 7 | 8 | "use strict"; 9 | 10 | jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + 11 | "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 12 | "change select submit keydown keypress keyup contextmenu" ).split( " " ), 13 | function( i, name ) { 14 | 15 | // Handle event binding 16 | jQuery.fn[ name ] = function( data, fn ) { 17 | return arguments.length > 0 ? 18 | this.on( name, null, data, fn ) : 19 | this.trigger( name ); 20 | }; 21 | } ); 22 | 23 | jQuery.fn.extend( { 24 | hover: function( fnOver, fnOut ) { 25 | return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 26 | } 27 | } ); 28 | 29 | } ); 30 | -------------------------------------------------------------------------------- /bower_components/jquery/src/jquery.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./core", 3 | "./selector", 4 | "./traversing", 5 | "./callbacks", 6 | "./deferred", 7 | "./deferred/exceptionHook", 8 | "./core/ready", 9 | "./data", 10 | "./queue", 11 | "./queue/delay", 12 | "./attributes", 13 | "./event", 14 | "./event/alias", 15 | "./event/focusin", 16 | "./manipulation", 17 | "./manipulation/_evalUrl", 18 | "./wrap", 19 | "./css", 20 | "./css/hiddenVisibleSelectors", 21 | "./serialize", 22 | "./ajax", 23 | "./ajax/xhr", 24 | "./ajax/script", 25 | "./ajax/jsonp", 26 | "./ajax/load", 27 | "./event/ajax", 28 | "./effects", 29 | "./effects/animatedSelector", 30 | "./offset", 31 | "./dimensions", 32 | "./deprecated", 33 | "./exports/amd" 34 | ], function( jQuery ) { 35 | 36 | "use strict"; 37 | 38 | return ( window.jQuery = window.$ = jQuery ); 39 | 40 | } ); 41 | -------------------------------------------------------------------------------- /bower_components/jquery/src/exports/global.js: -------------------------------------------------------------------------------- 1 | /* ExcludeStart */ 2 | 3 | // This file is included in a different way from all the others 4 | // so the "use strict" pragma is not needed. 5 | /* eslint strict: "off" */ 6 | 7 | /* ExcludeEnd */ 8 | 9 | var 10 | 11 | // Map over jQuery in case of overwrite 12 | _jQuery = window.jQuery, 13 | 14 | // Map over the $ in case of overwrite 15 | _$ = window.$; 16 | 17 | jQuery.noConflict = function( deep ) { 18 | if ( window.$ === jQuery ) { 19 | window.$ = _$; 20 | } 21 | 22 | if ( deep && window.jQuery === jQuery ) { 23 | window.jQuery = _jQuery; 24 | } 25 | 26 | return jQuery; 27 | }; 28 | 29 | // Expose jQuery and $ identifiers, even in AMD 30 | // (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 31 | // and CommonJS for browser emulators (#13566) 32 | if ( !noGlobal ) { 33 | window.jQuery = window.$ = jQuery; 34 | } 35 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery_push_notification", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "push_notification.js", 6 | "dependencies": {}, 7 | "devDependencies": { 8 | "karma": "^1.1.1", 9 | "karma-chrome-launcher": "^1.0.1", 10 | "karma-firefox-launcher": "^1.0.0", 11 | "karma-ie-launcher": "^1.0.0", 12 | "karma-jasmine": "^1.0.2", 13 | "karma-opera-launcher": "^1.0.0", 14 | "karma-safari-launcher": "^1.0.0" 15 | }, 16 | "scripts": { 17 | "test": "node_modules/karma/bin/karma start" 18 | }, 19 | "repository": { 20 | "type": "git", 21 | "url": "git+https://github.com/asmsuechan/jquery_push_notification.git" 22 | }, 23 | "author": "asmsuechan", 24 | "license": "ISC", 25 | "bugs": { 26 | "url": "https://github.com/asmsuechan/jquery_push_notification/issues" 27 | }, 28 | "homepage": "https://github.com/asmsuechan/jquery_push_notification#readme" 29 | } 30 | -------------------------------------------------------------------------------- /bower_components/jquery/src/manipulation/wrapMap.js: -------------------------------------------------------------------------------- 1 | define( function() { 2 | 3 | "use strict"; 4 | 5 | // We have to close these tags to support XHTML (#13200) 6 | var wrapMap = { 7 | 8 | // Support: IE <=9 only 9 | option: [ 1, "" ], 10 | 11 | // XHTML parsers do not magically insert elements in the 12 | // same way that tag soup parsers do. So we cannot shorten 13 | // this by omitting or other required elements. 14 | thead: [ 1, "", "
" ], 15 | col: [ 2, "", "
" ], 16 | tr: [ 2, "", "
" ], 17 | td: [ 3, "", "
" ], 18 | 19 | _default: [ 0, "", "" ] 20 | }; 21 | 22 | // Support: IE <=9 only 23 | wrapMap.optgroup = wrapMap.option; 24 | 25 | wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 26 | wrapMap.th = wrapMap.td; 27 | 28 | return wrapMap; 29 | } ); 30 | -------------------------------------------------------------------------------- /bower_components/jquery/src/attributes/support.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../var/document", 3 | "../var/support" 4 | ], function( document, support ) { 5 | 6 | "use strict"; 7 | 8 | ( function() { 9 | var input = document.createElement( "input" ), 10 | select = document.createElement( "select" ), 11 | opt = select.appendChild( document.createElement( "option" ) ); 12 | 13 | input.type = "checkbox"; 14 | 15 | // Support: Android <=4.3 only 16 | // Default value for a checkbox should be "on" 17 | support.checkOn = input.value !== ""; 18 | 19 | // Support: IE <=11 only 20 | // Must access selectedIndex to make default options select 21 | support.optSelected = opt.selected; 22 | 23 | // Support: IE <=11 only 24 | // An input loses its value after becoming a radio 25 | input = document.createElement( "input" ); 26 | input.value = "t"; 27 | input.type = "radio"; 28 | support.radioValue = input.value === "t"; 29 | } )(); 30 | 31 | return support; 32 | 33 | } ); 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 asmsuechan 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /bower_components/jasmine-jquery/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jasmine-jquery", 3 | "description": "jQuery matchers and fixture loader for Jasmine framework", 4 | "version": "2.1.1", 5 | "keywords": [ 6 | "jasmine", 7 | "jquery" 8 | ], 9 | "main": "lib/jasmine-jquery.js", 10 | "files": [ 11 | "lib/" 12 | ], 13 | "homepage": "http://github.com/velesin/jasmine-jquery", 14 | "author": { 15 | "name": "Travis Jeffery", 16 | "email": "tj@travisjeffery.com", 17 | "url": "travisjeffery.com" 18 | }, 19 | "scripts": { 20 | "test": "grunt test" 21 | }, 22 | "repository": { 23 | "type": "git", 24 | "url": "https://github.com/velesin/jasmine-jquery.git" 25 | }, 26 | "bugs": { 27 | "url": "http://github.com/velesin/jasmine-jquery/issues" 28 | }, 29 | "license": "MIT", 30 | "devDependencies": { 31 | "grunt": "0.4.5", 32 | "grunt-contrib-jshint": "0.10.0", 33 | "grunt-contrib-jasmine": "git://github.com/travisjeffery/grunt-contrib-jasmine#9d5874dd592cf41e8268918fe9baeb261afd75b2" 34 | } 35 | } -------------------------------------------------------------------------------- /bower_components/jquery/src/exports/amd.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | "use strict"; 6 | 7 | // Register as a named AMD module, since jQuery can be concatenated with other 8 | // files that may use define, but not via a proper concatenation script that 9 | // understands anonymous AMD modules. A named AMD is safest and most robust 10 | // way to register. Lowercase jquery is used because AMD module names are 11 | // derived from file names, and jQuery is normally delivered in a lowercase 12 | // file name. Do this after creating the global so that if an AMD module wants 13 | // to call noConflict to hide this version of jQuery, it will work. 14 | 15 | // Note that for maximum portability, libraries that are not jQuery should 16 | // declare themselves as anonymous modules, and avoid setting a global if an 17 | // AMD loader is present. jQuery is a special case. For more information, see 18 | // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 19 | 20 | if ( typeof define === "function" && define.amd ) { 21 | define( "jquery", [], function() { 22 | return jQuery; 23 | } ); 24 | } 25 | 26 | } ); 27 | -------------------------------------------------------------------------------- /push_notification.min.js: -------------------------------------------------------------------------------- 1 | (function(){!function(t){var i;return i={create_notification:function(t){return new Notification(t.title,t)},close_notification:function(t,i){return setTimeout(t.close.bind(t),i.closeTime)},set_default_icon:function(t){return default_options.icon=t},isSupported:function(){return"Notification"in window&&"denied"!==Notification.permission?!0:!1},permission_request:function(){return"default"===Notification.permission?Notification.requestPermission():void 0}},t.extend({notify:function(n,e){var o,r;if(arguments.length<1)throw"Notification: few arguments";if("string"!=typeof n)throw"Notification: body must 'String'";var c={title:"Notification",body:"Body",closeTime:5e3,icon:""};return c.body=n,r=t.extend(c,e),i.isSupported()?(i.permission_request(),o=i.create_notification(r),i.close_notification(o,r),{click:function(t){return o.addEventListener("click",function(){return t()}),this},show:function(t){return o.addEventListener("show",function(){return t()}),this},close:function(t){return o.addEventListener("close",function(){return t()}),this},error:function(t){return o.addEventListener("error",function(){return t()}),this}}):void 0}})}(jQuery)}).call(this); 2 | -------------------------------------------------------------------------------- /bower_components/jasmine-jquery/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010-2014 Wojciech Zawistowski, Travis Jeffery 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.ja.md: -------------------------------------------------------------------------------- 1 | JqueryPushNotification 2 | ==== 3 | 4 | ## 概要 5 | このライブラリはNotificationAPIをjQueryで使用できるようにしたものです。 6 | 7 | ## デモ 8 | もっともシンプルな使用例は以下のように書きます 9 | ``` 10 | $.notify("body") 11 | ``` 12 | 13 | [デモサイト](https://asmsuechan.github.io/jquery_push_notification/) 14 | 15 | ## 使い方 16 | このライブラリを使用するにはjQueryが必要になります 17 | ``` 18 | 19 | ``` 20 | 21 | エッジを使いたいのであればrawgitからインクルードしてください 22 | ``` 23 | 24 | ``` 25 | 26 | .minファイルも使用できます 27 | ``` 28 | 29 | ``` 30 | 31 | ## もっと見る 32 | [MDN Notification API](https://developer.mozilla.org/ja/docs/Web/API/Notifications_API) 33 | 34 | ## Contribution 35 | バグや改善点を見つけたらいつでもプルリクエストを送ってください! 36 | 37 | みなさんのプルリクエストをお待ちしております! 38 | 39 | ## Licence 40 | 41 | [MIT](https://github.com/asmsuechan/jquery_push_notification/blob/master/LICENCE) 42 | 43 | ## 作者 44 | 45 | [asmsuechan](https://github.com/asmsuechan) 46 | -------------------------------------------------------------------------------- /bower_components/jquery/src/manipulation/support.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../var/document", 3 | "../var/support" 4 | ], function( document, support ) { 5 | 6 | "use strict"; 7 | 8 | ( function() { 9 | var fragment = document.createDocumentFragment(), 10 | div = fragment.appendChild( document.createElement( "div" ) ), 11 | input = document.createElement( "input" ); 12 | 13 | // Support: Android 4.0 - 4.3 only 14 | // Check state lost if the name is set (#11217) 15 | // Support: Windows Web Apps (WWA) 16 | // `name` and `type` must use .setAttribute for WWA (#14901) 17 | input.setAttribute( "type", "radio" ); 18 | input.setAttribute( "checked", "checked" ); 19 | input.setAttribute( "name", "t" ); 20 | 21 | div.appendChild( input ); 22 | 23 | // Support: Android <=4.1 only 24 | // Older WebKit doesn't clone checked state correctly in fragments 25 | support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 26 | 27 | // Support: IE <=11 only 28 | // Make sure textarea (and checkbox) defaultValue is properly cloned 29 | div.innerHTML = ""; 30 | support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 31 | } )(); 32 | 33 | return support; 34 | 35 | } ); 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | JqueryPushNotification 2 | ==== 3 | 4 | [日本語](https://github.com/asmsuechan/jquery_push_notification/blob/master/README.ja.md) 5 | 6 | ## Description 7 | This library expands jquery for use html5 NotificationAPI. 8 | 9 | ## Demo 10 | The following is the most simple usecase. 11 | ``` 12 | $.notify("body") 13 | ``` 14 | 15 | [Demosite](https://asmsuechan.github.io/jquery_push_notification/) 16 | 17 | ## Usage 18 | Before you use, include jquery. 19 | ``` 20 | 21 | ``` 22 | 23 | If you'd like to use edge, you can include by the following. 24 | ``` 25 | 26 | ``` 27 | 28 | You can also use minified file. 29 | ``` 30 | 31 | ``` 32 | 33 | ## Further Reading 34 | [MDN Notification API](https://developer.mozilla.org/ja/docs/Web/API/Notifications_API) 35 | 36 | ## Contribution 37 | When you detect bugs or improvements, you can send PRs! 38 | 39 | I'm looking forward to your PRs! 40 | 41 | ## Licence 42 | 43 | [MIT](https://github.com/asmsuechan/jquery_push_notification/blob/master/LICENSE) 44 | 45 | ## Author 46 | 47 | [asmsuechan](https://github.com/asmsuechan) 48 | -------------------------------------------------------------------------------- /bower_components/jasmine-jquery/Gruntfile.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | 3 | module.exports = function (grunt) { 4 | "use strict"; 5 | 6 | grunt.initConfig({ 7 | pkg: grunt.file.readJSON('package.json') 8 | , jshint: { 9 | all: [ 10 | "Gruntfile.js" 11 | , "lib/**/*.js" 12 | , "spec/**/*.js" 13 | ] 14 | , options: { 15 | jshintrc: '.jshintrc' 16 | }, 17 | } 18 | , jasmine: { 19 | src: "lib/**/*.js" 20 | , options: { 21 | specs: "spec/**/*.js" 22 | , vendor: "vendor/**/*.js" 23 | , version: '2.0.0' 24 | } 25 | } 26 | }) 27 | 28 | grunt.loadNpmTasks('grunt-contrib-jshint') 29 | grunt.loadNpmTasks('grunt-contrib-jasmine') 30 | 31 | grunt.registerTask('syncversion', "Sync the versions between files.", function () { 32 | var json = require('./package.json') 33 | var fs = require('fs') 34 | var file = './lib/jasmine-jquery.js' 35 | 36 | fs.readFile(file, 'utf8', function (err, data) { 37 | if (err) return console.log(err) 38 | 39 | var res = data.replace(/^Version .*$/m, 'Version ' + json.version) 40 | 41 | fs.writeFile(file, res, 'utf8', function (err) { 42 | if (err) return console.log(err) 43 | }) 44 | }) 45 | }) 46 | 47 | grunt.registerTask('test', ['jshint', 'jasmine']) 48 | grunt.registerTask('default', ['syncversion', 'test']) 49 | }; 50 | -------------------------------------------------------------------------------- /bower_components/jquery/src/css/var/isHiddenWithinTree.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../../core", 3 | "../../selector" 4 | 5 | // css is assumed 6 | ], function( jQuery ) { 7 | "use strict"; 8 | 9 | // isHiddenWithinTree reports if an element has a non-"none" display style (inline and/or 10 | // through the CSS cascade), which is useful in deciding whether or not to make it visible. 11 | // It differs from the :hidden selector (jQuery.expr.pseudos.hidden) in two important ways: 12 | // * A hidden ancestor does not force an element to be classified as hidden. 13 | // * Being disconnected from the document does not force an element to be classified as hidden. 14 | // These differences improve the behavior of .toggle() et al. when applied to elements that are 15 | // detached or contained within hidden ancestors (gh-2404, gh-2863). 16 | return function( elem, el ) { 17 | 18 | // isHiddenWithinTree might be called from jQuery#filter function; 19 | // in that case, element will be second argument 20 | elem = el || elem; 21 | 22 | // Inline style trumps all 23 | return elem.style.display === "none" || 24 | elem.style.display === "" && 25 | 26 | // Otherwise, check computed style 27 | // Support: Firefox <=43 - 45 28 | // Disconnected elements can have computed display: none, so first confirm that elem is 29 | // in the document. 30 | jQuery.contains( elem.ownerDocument, elem ) && 31 | 32 | jQuery.css( elem, "display" ) === "none"; 33 | }; 34 | } ); 35 | -------------------------------------------------------------------------------- /bower_components/jquery/src/core/access.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | "use strict"; 6 | 7 | // Multifunctional method to get and set values of a collection 8 | // The value/s can optionally be executed if it's a function 9 | var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 10 | var i = 0, 11 | len = elems.length, 12 | bulk = key == null; 13 | 14 | // Sets many values 15 | if ( jQuery.type( key ) === "object" ) { 16 | chainable = true; 17 | for ( i in key ) { 18 | access( elems, fn, i, key[ i ], true, emptyGet, raw ); 19 | } 20 | 21 | // Sets one value 22 | } else if ( value !== undefined ) { 23 | chainable = true; 24 | 25 | if ( !jQuery.isFunction( value ) ) { 26 | raw = true; 27 | } 28 | 29 | if ( bulk ) { 30 | 31 | // Bulk operations run against the entire set 32 | if ( raw ) { 33 | fn.call( elems, value ); 34 | fn = null; 35 | 36 | // ...except when executing function values 37 | } else { 38 | bulk = fn; 39 | fn = function( elem, key, value ) { 40 | return bulk.call( jQuery( elem ), value ); 41 | }; 42 | } 43 | } 44 | 45 | if ( fn ) { 46 | for ( ; i < len; i++ ) { 47 | fn( 48 | elems[ i ], key, raw ? 49 | value : 50 | value.call( elems[ i ], i, fn( elems[ i ], key ) ) 51 | ); 52 | } 53 | } 54 | } 55 | 56 | return chainable ? 57 | elems : 58 | 59 | // Gets 60 | bulk ? 61 | fn.call( elems ) : 62 | len ? fn( elems[ 0 ], key ) : emptyGet; 63 | }; 64 | 65 | return access; 66 | 67 | } ); 68 | -------------------------------------------------------------------------------- /bower_components/jasmine-jquery/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Jasmine-jQuery 2 | 3 | Looking to contribute something to Jasmine-jQuery? **Here's how you can help.** 4 | 5 | ## Reporting issues 6 | 7 | We only accept issues that are bug reports or feature requests. Bugs must be isolated and reproducible problems that we can fix within the Jasmine-jQuery. Please read the following guidelines before opening any issue. 8 | 9 | 1. **Search for existing issues.** Somemeone else may have reported the same issue. Moreover, the issue may have already been resolved with a fix available. 10 | 2. **Create an isolated and reproducible test case.** Be sure the problem exists in Jasmine-jQuery's code with a [reduced test case](http://css-tricks.com/reduced-test-cases/) that should be included in each bug report. 11 | 3. **Include a live example.** Make use of jsFiddle or jsBin to share your isolated test cases. 12 | 4. **Share as much information as possible.** Include operating system and version, browser and version, version of Jasmine-jQuery. Also include steps to reproduce the bug. 13 | 14 | ## Pull requests 15 | 16 | - Try not to pollute your pull request with unintended changes--keep them simple and small 17 | - Please squash your commits when appropriate. This simplifies future cherry picks, and also keeps the git log clean. 18 | - Include tests that fail without your code, and pass with it. 19 | - Update the documentation, examples elsewhere, and the guides: whatever is affected by your contribution. 20 | - If you can, have another developer sanity check your change. 21 | 22 | ## Coding standards 23 | 24 | - No semicolons 25 | - Comma first 26 | - 2 spaces (no tabs) 27 | - strict mode 28 | - "Attractive" 29 | -------------------------------------------------------------------------------- /bower_components/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /bower_components/jquery/src/event/focusin.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../data/var/dataPriv", 4 | "./support", 5 | 6 | "../event", 7 | "./trigger" 8 | ], function( jQuery, dataPriv, support ) { 9 | 10 | "use strict"; 11 | 12 | // Support: Firefox <=44 13 | // Firefox doesn't have focus(in | out) events 14 | // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 15 | // 16 | // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 17 | // focus(in | out) events fire after focus & blur events, 18 | // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 19 | // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 20 | if ( !support.focusin ) { 21 | jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { 22 | 23 | // Attach a single capturing handler on the document while someone wants focusin/focusout 24 | var handler = function( event ) { 25 | jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); 26 | }; 27 | 28 | jQuery.event.special[ fix ] = { 29 | setup: function() { 30 | var doc = this.ownerDocument || this, 31 | attaches = dataPriv.access( doc, fix ); 32 | 33 | if ( !attaches ) { 34 | doc.addEventListener( orig, handler, true ); 35 | } 36 | dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); 37 | }, 38 | teardown: function() { 39 | var doc = this.ownerDocument || this, 40 | attaches = dataPriv.access( doc, fix ) - 1; 41 | 42 | if ( !attaches ) { 43 | doc.removeEventListener( orig, handler, true ); 44 | dataPriv.remove( doc, fix ); 45 | 46 | } else { 47 | dataPriv.access( doc, fix, attaches ); 48 | } 49 | } 50 | }; 51 | } ); 52 | } 53 | 54 | return jQuery; 55 | } ); 56 | -------------------------------------------------------------------------------- /bower_components/jquery/external/sizzle/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/sizzle 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /bower_components/jquery/src/css/curCSS.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "./var/rnumnonpx", 4 | "./var/rmargin", 5 | "./var/getStyles", 6 | "./support", 7 | "../selector" // Get jQuery.contains 8 | ], function( jQuery, rnumnonpx, rmargin, getStyles, support ) { 9 | 10 | "use strict"; 11 | 12 | function curCSS( elem, name, computed ) { 13 | var width, minWidth, maxWidth, ret, 14 | style = elem.style; 15 | 16 | computed = computed || getStyles( elem ); 17 | 18 | // Support: IE <=9 only 19 | // getPropertyValue is only needed for .css('filter') (#12537) 20 | if ( computed ) { 21 | ret = computed.getPropertyValue( name ) || computed[ name ]; 22 | 23 | if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { 24 | ret = jQuery.style( elem, name ); 25 | } 26 | 27 | // A tribute to the "awesome hack by Dean Edwards" 28 | // Android Browser returns percentage for some values, 29 | // but width seems to be reliably pixels. 30 | // This is against the CSSOM draft spec: 31 | // https://drafts.csswg.org/cssom/#resolved-values 32 | if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { 33 | 34 | // Remember the original values 35 | width = style.width; 36 | minWidth = style.minWidth; 37 | maxWidth = style.maxWidth; 38 | 39 | // Put in the new values to get a computed value out 40 | style.minWidth = style.maxWidth = style.width = ret; 41 | ret = computed.width; 42 | 43 | // Revert the changed values 44 | style.width = width; 45 | style.minWidth = minWidth; 46 | style.maxWidth = maxWidth; 47 | } 48 | } 49 | 50 | return ret !== undefined ? 51 | 52 | // Support: IE <=9 - 11 only 53 | // IE returns zIndex value as an integer. 54 | ret + "" : 55 | ret; 56 | } 57 | 58 | return curCSS; 59 | } ); 60 | -------------------------------------------------------------------------------- /bower_components/jquery/src/wrap.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./core", 3 | "./core/init", 4 | "./manipulation", // clone 5 | "./traversing" // parent, contents 6 | ], function( jQuery ) { 7 | 8 | "use strict"; 9 | 10 | jQuery.fn.extend( { 11 | wrapAll: function( html ) { 12 | var wrap; 13 | 14 | if ( this[ 0 ] ) { 15 | if ( jQuery.isFunction( html ) ) { 16 | html = html.call( this[ 0 ] ); 17 | } 18 | 19 | // The elements to wrap the target around 20 | wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 21 | 22 | if ( this[ 0 ].parentNode ) { 23 | wrap.insertBefore( this[ 0 ] ); 24 | } 25 | 26 | wrap.map( function() { 27 | var elem = this; 28 | 29 | while ( elem.firstElementChild ) { 30 | elem = elem.firstElementChild; 31 | } 32 | 33 | return elem; 34 | } ).append( this ); 35 | } 36 | 37 | return this; 38 | }, 39 | 40 | wrapInner: function( html ) { 41 | if ( jQuery.isFunction( html ) ) { 42 | return this.each( function( i ) { 43 | jQuery( this ).wrapInner( html.call( this, i ) ); 44 | } ); 45 | } 46 | 47 | return this.each( function() { 48 | var self = jQuery( this ), 49 | contents = self.contents(); 50 | 51 | if ( contents.length ) { 52 | contents.wrapAll( html ); 53 | 54 | } else { 55 | self.append( html ); 56 | } 57 | } ); 58 | }, 59 | 60 | wrap: function( html ) { 61 | var isFunction = jQuery.isFunction( html ); 62 | 63 | return this.each( function( i ) { 64 | jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html ); 65 | } ); 66 | }, 67 | 68 | unwrap: function( selector ) { 69 | this.parent( selector ).not( "body" ).each( function() { 70 | jQuery( this ).replaceWith( this.childNodes ); 71 | } ); 72 | return this; 73 | } 74 | } ); 75 | 76 | return jQuery; 77 | } ); 78 | -------------------------------------------------------------------------------- /bower_components/jquery/src/core/parseHTML.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../var/document", 4 | "./var/rsingleTag", 5 | "../manipulation/buildFragment", 6 | 7 | // This is the only module that needs core/support 8 | "./support" 9 | ], function( jQuery, document, rsingleTag, buildFragment, support ) { 10 | 11 | "use strict"; 12 | 13 | // Argument "data" should be string of html 14 | // context (optional): If specified, the fragment will be created in this context, 15 | // defaults to document 16 | // keepScripts (optional): If true, will include scripts passed in the html string 17 | jQuery.parseHTML = function( data, context, keepScripts ) { 18 | if ( typeof data !== "string" ) { 19 | return []; 20 | } 21 | if ( typeof context === "boolean" ) { 22 | keepScripts = context; 23 | context = false; 24 | } 25 | 26 | var base, parsed, scripts; 27 | 28 | if ( !context ) { 29 | 30 | // Stop scripts or inline event handlers from being executed immediately 31 | // by using document.implementation 32 | if ( support.createHTMLDocument ) { 33 | context = document.implementation.createHTMLDocument( "" ); 34 | 35 | // Set the base href for the created document 36 | // so any parsed elements with URLs 37 | // are based on the document's URL (gh-2965) 38 | base = context.createElement( "base" ); 39 | base.href = document.location.href; 40 | context.head.appendChild( base ); 41 | } else { 42 | context = document; 43 | } 44 | } 45 | 46 | parsed = rsingleTag.exec( data ); 47 | scripts = !keepScripts && []; 48 | 49 | // Single tag 50 | if ( parsed ) { 51 | return [ context.createElement( parsed[ 1 ] ) ]; 52 | } 53 | 54 | parsed = buildFragment( [ data ], context, scripts ); 55 | 56 | if ( scripts && scripts.length ) { 57 | jQuery( scripts ).remove(); 58 | } 59 | 60 | return jQuery.merge( [], parsed.childNodes ); 61 | }; 62 | 63 | return jQuery.parseHTML; 64 | 65 | } ); 66 | -------------------------------------------------------------------------------- /bower_components/jquery/src/ajax/script.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../var/document", 4 | "../ajax" 5 | ], function( jQuery, document ) { 6 | 7 | "use strict"; 8 | 9 | // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) 10 | jQuery.ajaxPrefilter( function( s ) { 11 | if ( s.crossDomain ) { 12 | s.contents.script = false; 13 | } 14 | } ); 15 | 16 | // Install script dataType 17 | jQuery.ajaxSetup( { 18 | accepts: { 19 | script: "text/javascript, application/javascript, " + 20 | "application/ecmascript, application/x-ecmascript" 21 | }, 22 | contents: { 23 | script: /\b(?:java|ecma)script\b/ 24 | }, 25 | converters: { 26 | "text script": function( text ) { 27 | jQuery.globalEval( text ); 28 | return text; 29 | } 30 | } 31 | } ); 32 | 33 | // Handle cache's special case and crossDomain 34 | jQuery.ajaxPrefilter( "script", function( s ) { 35 | if ( s.cache === undefined ) { 36 | s.cache = false; 37 | } 38 | if ( s.crossDomain ) { 39 | s.type = "GET"; 40 | } 41 | } ); 42 | 43 | // Bind script tag hack transport 44 | jQuery.ajaxTransport( "script", function( s ) { 45 | 46 | // This transport only deals with cross domain requests 47 | if ( s.crossDomain ) { 48 | var script, callback; 49 | return { 50 | send: function( _, complete ) { 51 | script = jQuery( " 18 | ``` 19 | 20 | #### Babel 21 | 22 | [Babel](http://babeljs.io/) is a next generation JavaScript compiler. One of the features is the ability to use ES6/ES2015 modules now, even though browsers do not yet support this feature natively. 23 | 24 | ```js 25 | import $ from "jquery"; 26 | ``` 27 | 28 | #### Browserify/Webpack 29 | 30 | There are several ways to use [Browserify](http://browserify.org/) and [Webpack](https://webpack.github.io/). For more information on using these tools, please refer to the corresponding project's documention. In the script, including jQuery will usually look like this... 31 | 32 | ```js 33 | var $ = require("jquery"); 34 | ``` 35 | 36 | #### AMD (Asynchronous Module Definition) 37 | 38 | AMD is a module format built for the browser. For more information, we recommend [require.js' documentation](http://requirejs.org/docs/whyamd.html). 39 | 40 | ```js 41 | define(["jquery"], function($) { 42 | 43 | }); 44 | ``` 45 | 46 | ### Node 47 | 48 | To include jQuery in [Node](nodejs.org), first install with npm. 49 | 50 | ```sh 51 | npm install jquery 52 | ``` 53 | 54 | For jQuery to work in Node, a window with a document is required. Since no such window exists natively in Node, one can be mocked by tools such as [jsdom](https://github.com/tmpvar/jsdom). This can be useful for testing purposes. 55 | 56 | ```js 57 | require("jsdom").env("", function(err, window) { 58 | if (err) { 59 | console.error(err); 60 | return; 61 | } 62 | 63 | var $ = require("jquery")(window); 64 | }); 65 | ``` 66 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration 2 | // Generated on Wed Jul 20 2016 00:06:03 GMT+0900 (JST) 3 | 4 | module.exports = function(config) { 5 | config.set({ 6 | 7 | // base path that will be used to resolve all patterns (eg. files, exclude) 8 | basePath: '', 9 | 10 | 11 | // frameworks to use 12 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter 13 | frameworks: ['jasmine'], 14 | 15 | 16 | // list of files / patterns to load in the browser 17 | files: [ 18 | 'bower_components/jquery/dist/jquery.min.js', 19 | 'bower_components/jasmine-jquery/lib/jasmine-jquery.js', 20 | 'push_notification.js', 21 | 'test/unit/*Spec.js' 22 | ], 23 | 24 | 25 | // list of files to exclude 26 | exclude: [ 27 | ], 28 | 29 | 30 | // preprocess matching files before serving them to the browser 31 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor 32 | preprocessors: { 33 | }, 34 | 35 | 36 | // test results reporter to use 37 | // possible values: 'dots', 'progress' 38 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter 39 | reporters: ['progress'], 40 | 41 | 42 | // web server port 43 | port: 9876, 44 | 45 | 46 | // enable / disable colors in the output (reporters and logs) 47 | colors: true, 48 | 49 | 50 | // level of logging 51 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG 52 | logLevel: config.LOG_INFO, 53 | 54 | 55 | // enable / disable watching file and executing tests whenever any file changes 56 | autoWatch: true, 57 | 58 | 59 | // start these browsers 60 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher 61 | browsers: ['Chrome', 'Firefox', 'Safari'], 62 | 63 | 64 | // Continuous Integration mode 65 | // if true, Karma captures browsers, runs the tests and exits 66 | singleRun: false, 67 | 68 | // Concurrency level 69 | // how many browser should be started simultaneous 70 | concurrency: Infinity 71 | }) 72 | } 73 | -------------------------------------------------------------------------------- /bower_components/jquery/src/ajax/load.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../core/parseHTML", 4 | "../ajax", 5 | "../traversing", 6 | "../manipulation", 7 | "../selector" 8 | ], function( jQuery ) { 9 | 10 | "use strict"; 11 | 12 | /** 13 | * Load a url into a page 14 | */ 15 | jQuery.fn.load = function( url, params, callback ) { 16 | var selector, type, response, 17 | self = this, 18 | off = url.indexOf( " " ); 19 | 20 | if ( off > -1 ) { 21 | selector = jQuery.trim( url.slice( off ) ); 22 | url = url.slice( 0, off ); 23 | } 24 | 25 | // If it's a function 26 | if ( jQuery.isFunction( params ) ) { 27 | 28 | // We assume that it's the callback 29 | callback = params; 30 | params = undefined; 31 | 32 | // Otherwise, build a param string 33 | } else if ( params && typeof params === "object" ) { 34 | type = "POST"; 35 | } 36 | 37 | // If we have elements to modify, make the request 38 | if ( self.length > 0 ) { 39 | jQuery.ajax( { 40 | url: url, 41 | 42 | // If "type" variable is undefined, then "GET" method will be used. 43 | // Make value of this field explicit since 44 | // user can override it through ajaxSetup method 45 | type: type || "GET", 46 | dataType: "html", 47 | data: params 48 | } ).done( function( responseText ) { 49 | 50 | // Save response for use in complete callback 51 | response = arguments; 52 | 53 | self.html( selector ? 54 | 55 | // If a selector was specified, locate the right elements in a dummy div 56 | // Exclude scripts to avoid IE 'Permission Denied' errors 57 | jQuery( "
" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 58 | 59 | // Otherwise use the full result 60 | responseText ); 61 | 62 | // If the request succeeds, this function gets "data", "status", "jqXHR" 63 | // but they are ignored because response was set above. 64 | // If it fails, this function gets "jqXHR", "status", "error" 65 | } ).always( callback && function( jqXHR, status ) { 66 | self.each( function() { 67 | callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 68 | } ); 69 | } ); 70 | } 71 | 72 | return this; 73 | }; 74 | 75 | } ); 76 | -------------------------------------------------------------------------------- /bower_components/jquery/src/css/adjustCSS.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../var/rcssNum" 4 | ], function( jQuery, rcssNum ) { 5 | 6 | "use strict"; 7 | 8 | function adjustCSS( elem, prop, valueParts, tween ) { 9 | var adjusted, 10 | scale = 1, 11 | maxIterations = 20, 12 | currentValue = tween ? 13 | function() { 14 | return tween.cur(); 15 | } : 16 | function() { 17 | return jQuery.css( elem, prop, "" ); 18 | }, 19 | initial = currentValue(), 20 | unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 21 | 22 | // Starting value computation is required for potential unit mismatches 23 | initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 24 | rcssNum.exec( jQuery.css( elem, prop ) ); 25 | 26 | if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 27 | 28 | // Trust units reported by jQuery.css 29 | unit = unit || initialInUnit[ 3 ]; 30 | 31 | // Make sure we update the tween properties later on 32 | valueParts = valueParts || []; 33 | 34 | // Iteratively approximate from a nonzero starting point 35 | initialInUnit = +initial || 1; 36 | 37 | do { 38 | 39 | // If previous iteration zeroed out, double until we get *something*. 40 | // Use string for doubling so we don't accidentally see scale as unchanged below 41 | scale = scale || ".5"; 42 | 43 | // Adjust and apply 44 | initialInUnit = initialInUnit / scale; 45 | jQuery.style( elem, prop, initialInUnit + unit ); 46 | 47 | // Update scale, tolerating zero or NaN from tween.cur() 48 | // Break the loop if scale is unchanged or perfect, or if we've just had enough. 49 | } while ( 50 | scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations 51 | ); 52 | } 53 | 54 | if ( valueParts ) { 55 | initialInUnit = +initialInUnit || +initial || 0; 56 | 57 | // Apply relative offset (+=/-=) if specified 58 | adjusted = valueParts[ 1 ] ? 59 | initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 60 | +valueParts[ 2 ]; 61 | if ( tween ) { 62 | tween.unit = unit; 63 | tween.start = initialInUnit; 64 | tween.end = adjusted; 65 | } 66 | } 67 | return adjusted; 68 | } 69 | 70 | return adjustCSS; 71 | } ); 72 | -------------------------------------------------------------------------------- /push_notification.js.coffee: -------------------------------------------------------------------------------- 1 | (($) -> 2 | notify_methods = 3 | # create notification 4 | create_notification: (options) -> 5 | new Notification(options.title, options) 6 | 7 | # close notification 8 | close_notification: (notification, options) -> 9 | setTimeout(notification.close.bind(notification), options.closeTime) 10 | 11 | set_default_icon: (icon_url) -> 12 | default_options.icon = icon_url 13 | 14 | #return true if NotificationAPI is supported in your browser 15 | isSupported: () -> 16 | if ("Notification" of window) and (Notification.permission isnt "denied") 17 | return true 18 | else 19 | return false 20 | 21 | permission_request: () -> 22 | if Notification.permission is "default" 23 | Notification.requestPermission() 24 | 25 | $.extend 26 | 27 | notify: (body, arguments_options) -> 28 | throw "Notification: few arguments" if arguments.length < 1 29 | throw "Notification: body must 'String'" if typeof body != 'string' 30 | 31 | # set default options 32 | default_options = 33 | 'title' : "Notification" 34 | 'body' : "Body" 35 | 'closeTime' : 5000 36 | 37 | # merge default_options and arguments_options to options 38 | default_options.body = body 39 | options = $.extend default_options, arguments_options 40 | 41 | if notify_methods.isSupported() 42 | notify_methods.permission_request() 43 | 44 | notification = notify_methods.create_notification(options) 45 | notify_methods.close_notification(notification, options) 46 | 47 | # **callback functions** 48 | # callback after notification is clicked 49 | click : (callback) -> 50 | notification.addEventListener 'click', -> 51 | callback() 52 | return this 53 | 54 | # callback after notification is shown 55 | show : (callback) -> 56 | notification.addEventListener 'show', -> 57 | callback() 58 | return this 59 | 60 | # callback after notification is displaied 61 | close: (callback) -> 62 | notification.addEventListener 'close', -> 63 | callback() 64 | return this 65 | 66 | # callback after notification raises errors 67 | error : (callback) -> 68 | notification.addEventListener 'error', -> 69 | callback() 70 | return this 71 | ) jQuery 72 | -------------------------------------------------------------------------------- /bower_components/jquery/src/core/ready.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../var/document", 4 | "../core/readyException", 5 | "../deferred" 6 | ], function( jQuery, document ) { 7 | 8 | "use strict"; 9 | 10 | // The deferred used on DOM ready 11 | var readyList = jQuery.Deferred(); 12 | 13 | jQuery.fn.ready = function( fn ) { 14 | 15 | readyList 16 | .then( fn ) 17 | 18 | // Wrap jQuery.readyException in a function so that the lookup 19 | // happens at the time of error handling instead of callback 20 | // registration. 21 | .catch( function( error ) { 22 | jQuery.readyException( error ); 23 | } ); 24 | 25 | return this; 26 | }; 27 | 28 | jQuery.extend( { 29 | 30 | // Is the DOM ready to be used? Set to true once it occurs. 31 | isReady: false, 32 | 33 | // A counter to track how many items to wait for before 34 | // the ready event fires. See #6781 35 | readyWait: 1, 36 | 37 | // Hold (or release) the ready event 38 | holdReady: function( hold ) { 39 | if ( hold ) { 40 | jQuery.readyWait++; 41 | } else { 42 | jQuery.ready( true ); 43 | } 44 | }, 45 | 46 | // Handle when the DOM is ready 47 | ready: function( wait ) { 48 | 49 | // Abort if there are pending holds or we're already ready 50 | if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 51 | return; 52 | } 53 | 54 | // Remember that the DOM is ready 55 | jQuery.isReady = true; 56 | 57 | // If a normal DOM Ready event fired, decrement, and wait if need be 58 | if ( wait !== true && --jQuery.readyWait > 0 ) { 59 | return; 60 | } 61 | 62 | // If there are functions bound, to execute 63 | readyList.resolveWith( document, [ jQuery ] ); 64 | } 65 | } ); 66 | 67 | jQuery.ready.then = readyList.then; 68 | 69 | // The ready event handler and self cleanup method 70 | function completed() { 71 | document.removeEventListener( "DOMContentLoaded", completed ); 72 | window.removeEventListener( "load", completed ); 73 | jQuery.ready(); 74 | } 75 | 76 | // Catch cases where $(document).ready() is called 77 | // after the browser event has already occurred. 78 | // Support: IE <=9 - 10 only 79 | // Older IE sometimes signals "interactive" too soon 80 | if ( document.readyState === "complete" || 81 | ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 82 | 83 | // Handle it asynchronously to allow scripts the opportunity to delay ready 84 | window.setTimeout( jQuery.ready ); 85 | 86 | } else { 87 | 88 | // Use the handy event callback 89 | document.addEventListener( "DOMContentLoaded", completed ); 90 | 91 | // A fallback to window.onload, that will always work 92 | window.addEventListener( "load", completed ); 93 | } 94 | 95 | } ); 96 | -------------------------------------------------------------------------------- /push_notification.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | (function($) { 3 | var notify_methods; 4 | notify_methods = { 5 | create_notification: function(options) { 6 | return new Notification(options.title, options); 7 | }, 8 | close_notification: function(notification, options) { 9 | return setTimeout(notification.close.bind(notification), options.closeTime); 10 | }, 11 | set_default_icon: function(icon_url) { 12 | return default_options.icon = icon_url; 13 | }, 14 | isSupported: function() { 15 | if (("Notification" in window) && (Notification.permission !== "denied")) { 16 | return true; 17 | } else { 18 | return false; 19 | } 20 | }, 21 | permission_request: function() { 22 | if (Notification.permission === "default") { 23 | return Notification.requestPermission(); 24 | } 25 | } 26 | }; 27 | return $.extend({ 28 | notify: function(body, arguments_options) { 29 | var notification, options; 30 | if (arguments.length < 1) { 31 | throw "Notification: few arguments"; 32 | } 33 | if (typeof body !== 'string') { 34 | throw "Notification: body must 'String'"; 35 | } 36 | 37 | var default_options = { 38 | 'title': "Notification", 39 | 'body': "Body", 40 | 'closeTime': 5000, 41 | 'icon' : "" 42 | }; 43 | default_options.body = body; 44 | options = $.extend(default_options, arguments_options); 45 | if (notify_methods.isSupported()) { 46 | notify_methods.permission_request(); 47 | notification = notify_methods.create_notification(options); 48 | notify_methods.close_notification(notification, options); 49 | return { 50 | click: function(callback) { 51 | notification.addEventListener('click', function() { 52 | return callback(); 53 | }); 54 | return this; 55 | }, 56 | show: function(callback) { 57 | notification.addEventListener('show', function() { 58 | return callback(); 59 | }); 60 | return this; 61 | }, 62 | close: function(callback) { 63 | notification.addEventListener('close', function() { 64 | return callback(); 65 | }); 66 | return this; 67 | }, 68 | error: function(callback) { 69 | notification.addEventListener('error', function() { 70 | return callback(); 71 | }); 72 | return this; 73 | } 74 | }; 75 | } 76 | } 77 | }); 78 | })(jQuery); 79 | 80 | }).call(this); 81 | -------------------------------------------------------------------------------- /bower_components/jquery/src/css/support.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../var/document", 4 | "../var/documentElement", 5 | "../var/support" 6 | ], function( jQuery, document, documentElement, support ) { 7 | 8 | "use strict"; 9 | 10 | ( function() { 11 | 12 | // Executing both pixelPosition & boxSizingReliable tests require only one layout 13 | // so they're executed at the same time to save the second computation. 14 | function computeStyleTests() { 15 | 16 | // This is a singleton, we need to execute it only once 17 | if ( !div ) { 18 | return; 19 | } 20 | 21 | div.style.cssText = 22 | "box-sizing:border-box;" + 23 | "position:relative;display:block;" + 24 | "margin:auto;border:1px;padding:1px;" + 25 | "top:1%;width:50%"; 26 | div.innerHTML = ""; 27 | documentElement.appendChild( container ); 28 | 29 | var divStyle = window.getComputedStyle( div ); 30 | pixelPositionVal = divStyle.top !== "1%"; 31 | 32 | // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 33 | reliableMarginLeftVal = divStyle.marginLeft === "2px"; 34 | boxSizingReliableVal = divStyle.width === "4px"; 35 | 36 | // Support: Android 4.0 - 4.3 only 37 | // Some styles come back with percentage values, even though they shouldn't 38 | div.style.marginRight = "50%"; 39 | pixelMarginRightVal = divStyle.marginRight === "4px"; 40 | 41 | documentElement.removeChild( container ); 42 | 43 | // Nullify the div so it wouldn't be stored in the memory and 44 | // it will also be a sign that checks already performed 45 | div = null; 46 | } 47 | 48 | var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal, 49 | container = document.createElement( "div" ), 50 | div = document.createElement( "div" ); 51 | 52 | // Finish early in limited (non-browser) environments 53 | if ( !div.style ) { 54 | return; 55 | } 56 | 57 | // Support: IE <=9 - 11 only 58 | // Style of cloned element affects source element cloned (#8908) 59 | div.style.backgroundClip = "content-box"; 60 | div.cloneNode( true ).style.backgroundClip = ""; 61 | support.clearCloneStyle = div.style.backgroundClip === "content-box"; 62 | 63 | container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + 64 | "padding:0;margin-top:1px;position:absolute"; 65 | container.appendChild( div ); 66 | 67 | jQuery.extend( support, { 68 | pixelPosition: function() { 69 | computeStyleTests(); 70 | return pixelPositionVal; 71 | }, 72 | boxSizingReliable: function() { 73 | computeStyleTests(); 74 | return boxSizingReliableVal; 75 | }, 76 | pixelMarginRight: function() { 77 | computeStyleTests(); 78 | return pixelMarginRightVal; 79 | }, 80 | reliableMarginLeft: function() { 81 | computeStyleTests(); 82 | return reliableMarginLeftVal; 83 | } 84 | } ); 85 | } )(); 86 | 87 | return support; 88 | 89 | } ); 90 | -------------------------------------------------------------------------------- /bower_components/jquery/src/css/showHide.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../data/var/dataPriv", 4 | "../css/var/isHiddenWithinTree" 5 | ], function( jQuery, dataPriv, isHiddenWithinTree ) { 6 | 7 | "use strict"; 8 | 9 | var defaultDisplayMap = {}; 10 | 11 | function getDefaultDisplay( elem ) { 12 | var temp, 13 | doc = elem.ownerDocument, 14 | nodeName = elem.nodeName, 15 | display = defaultDisplayMap[ nodeName ]; 16 | 17 | if ( display ) { 18 | return display; 19 | } 20 | 21 | temp = doc.body.appendChild( doc.createElement( nodeName ) ), 22 | display = jQuery.css( temp, "display" ); 23 | 24 | temp.parentNode.removeChild( temp ); 25 | 26 | if ( display === "none" ) { 27 | display = "block"; 28 | } 29 | defaultDisplayMap[ nodeName ] = display; 30 | 31 | return display; 32 | } 33 | 34 | function showHide( elements, show ) { 35 | var display, elem, 36 | values = [], 37 | index = 0, 38 | length = elements.length; 39 | 40 | // Determine new display value for elements that need to change 41 | for ( ; index < length; index++ ) { 42 | elem = elements[ index ]; 43 | if ( !elem.style ) { 44 | continue; 45 | } 46 | 47 | display = elem.style.display; 48 | if ( show ) { 49 | 50 | // Since we force visibility upon cascade-hidden elements, an immediate (and slow) 51 | // check is required in this first loop unless we have a nonempty display value (either 52 | // inline or about-to-be-restored) 53 | if ( display === "none" ) { 54 | values[ index ] = dataPriv.get( elem, "display" ) || null; 55 | if ( !values[ index ] ) { 56 | elem.style.display = ""; 57 | } 58 | } 59 | if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { 60 | values[ index ] = getDefaultDisplay( elem ); 61 | } 62 | } else { 63 | if ( display !== "none" ) { 64 | values[ index ] = "none"; 65 | 66 | // Remember what we're overwriting 67 | dataPriv.set( elem, "display", display ); 68 | } 69 | } 70 | } 71 | 72 | // Set the display of the elements in a second loop to avoid constant reflow 73 | for ( index = 0; index < length; index++ ) { 74 | if ( values[ index ] != null ) { 75 | elements[ index ].style.display = values[ index ]; 76 | } 77 | } 78 | 79 | return elements; 80 | } 81 | 82 | jQuery.fn.extend( { 83 | show: function() { 84 | return showHide( this, true ); 85 | }, 86 | hide: function() { 87 | return showHide( this ); 88 | }, 89 | toggle: function( state ) { 90 | if ( typeof state === "boolean" ) { 91 | return state ? this.show() : this.hide(); 92 | } 93 | 94 | return this.each( function() { 95 | if ( isHiddenWithinTree( this ) ) { 96 | jQuery( this ).show(); 97 | } else { 98 | jQuery( this ).hide(); 99 | } 100 | } ); 101 | } 102 | } ); 103 | 104 | return showHide; 105 | } ); 106 | -------------------------------------------------------------------------------- /bower_components/jquery/src/traversing/findFilter.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../var/indexOf", 4 | "./var/rneedsContext", 5 | "../selector" 6 | ], function( jQuery, indexOf, rneedsContext ) { 7 | 8 | "use strict"; 9 | 10 | var risSimple = /^.[^:#\[\.,]*$/; 11 | 12 | // Implement the identical functionality for filter and not 13 | function winnow( elements, qualifier, not ) { 14 | if ( jQuery.isFunction( qualifier ) ) { 15 | return jQuery.grep( elements, function( elem, i ) { 16 | return !!qualifier.call( elem, i, elem ) !== not; 17 | } ); 18 | 19 | } 20 | 21 | if ( qualifier.nodeType ) { 22 | return jQuery.grep( elements, function( elem ) { 23 | return ( elem === qualifier ) !== not; 24 | } ); 25 | 26 | } 27 | 28 | if ( typeof qualifier === "string" ) { 29 | if ( risSimple.test( qualifier ) ) { 30 | return jQuery.filter( qualifier, elements, not ); 31 | } 32 | 33 | qualifier = jQuery.filter( qualifier, elements ); 34 | } 35 | 36 | return jQuery.grep( elements, function( elem ) { 37 | return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1; 38 | } ); 39 | } 40 | 41 | jQuery.filter = function( expr, elems, not ) { 42 | var elem = elems[ 0 ]; 43 | 44 | if ( not ) { 45 | expr = ":not(" + expr + ")"; 46 | } 47 | 48 | return elems.length === 1 && elem.nodeType === 1 ? 49 | jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : 50 | jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 51 | return elem.nodeType === 1; 52 | } ) ); 53 | }; 54 | 55 | jQuery.fn.extend( { 56 | find: function( selector ) { 57 | var i, ret, 58 | len = this.length, 59 | self = this; 60 | 61 | if ( typeof selector !== "string" ) { 62 | return this.pushStack( jQuery( selector ).filter( function() { 63 | for ( i = 0; i < len; i++ ) { 64 | if ( jQuery.contains( self[ i ], this ) ) { 65 | return true; 66 | } 67 | } 68 | } ) ); 69 | } 70 | 71 | ret = this.pushStack( [] ); 72 | 73 | for ( i = 0; i < len; i++ ) { 74 | jQuery.find( selector, self[ i ], ret ); 75 | } 76 | 77 | return len > 1 ? jQuery.uniqueSort( ret ) : ret; 78 | }, 79 | filter: function( selector ) { 80 | return this.pushStack( winnow( this, selector || [], false ) ); 81 | }, 82 | not: function( selector ) { 83 | return this.pushStack( winnow( this, selector || [], true ) ); 84 | }, 85 | is: function( selector ) { 86 | return !!winnow( 87 | this, 88 | 89 | // If this is a positional/relative selector, check membership in the returned set 90 | // so $("p:first").is("p:last") won't return true for a doc with two "p". 91 | typeof selector === "string" && rneedsContext.test( selector ) ? 92 | jQuery( selector ) : 93 | selector || [], 94 | false 95 | ).length; 96 | } 97 | } ); 98 | 99 | } ); 100 | -------------------------------------------------------------------------------- /bower_components/jquery/src/manipulation/buildFragment.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "./var/rtagName", 4 | "./var/rscriptType", 5 | "./wrapMap", 6 | "./getAll", 7 | "./setGlobalEval" 8 | ], function( jQuery, rtagName, rscriptType, wrapMap, getAll, setGlobalEval ) { 9 | 10 | "use strict"; 11 | 12 | var rhtml = /<|&#?\w+;/; 13 | 14 | function buildFragment( elems, context, scripts, selection, ignored ) { 15 | var elem, tmp, tag, wrap, contains, j, 16 | fragment = context.createDocumentFragment(), 17 | nodes = [], 18 | i = 0, 19 | l = elems.length; 20 | 21 | for ( ; i < l; i++ ) { 22 | elem = elems[ i ]; 23 | 24 | if ( elem || elem === 0 ) { 25 | 26 | // Add nodes directly 27 | if ( jQuery.type( elem ) === "object" ) { 28 | 29 | // Support: Android <=4.0 only, PhantomJS 1 only 30 | // push.apply(_, arraylike) throws on ancient WebKit 31 | jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 32 | 33 | // Convert non-html into a text node 34 | } else if ( !rhtml.test( elem ) ) { 35 | nodes.push( context.createTextNode( elem ) ); 36 | 37 | // Convert html into DOM nodes 38 | } else { 39 | tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); 40 | 41 | // Deserialize a standard representation 42 | tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 43 | wrap = wrapMap[ tag ] || wrapMap._default; 44 | tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 45 | 46 | // Descend through wrappers to the right content 47 | j = wrap[ 0 ]; 48 | while ( j-- ) { 49 | tmp = tmp.lastChild; 50 | } 51 | 52 | // Support: Android <=4.0 only, PhantomJS 1 only 53 | // push.apply(_, arraylike) throws on ancient WebKit 54 | jQuery.merge( nodes, tmp.childNodes ); 55 | 56 | // Remember the top-level container 57 | tmp = fragment.firstChild; 58 | 59 | // Ensure the created nodes are orphaned (#12392) 60 | tmp.textContent = ""; 61 | } 62 | } 63 | } 64 | 65 | // Remove wrapper from fragment 66 | fragment.textContent = ""; 67 | 68 | i = 0; 69 | while ( ( elem = nodes[ i++ ] ) ) { 70 | 71 | // Skip elements already in the context collection (trac-4087) 72 | if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 73 | if ( ignored ) { 74 | ignored.push( elem ); 75 | } 76 | continue; 77 | } 78 | 79 | contains = jQuery.contains( elem.ownerDocument, elem ); 80 | 81 | // Append to fragment 82 | tmp = getAll( fragment.appendChild( elem ), "script" ); 83 | 84 | // Preserve script evaluation history 85 | if ( contains ) { 86 | setGlobalEval( tmp ); 87 | } 88 | 89 | // Capture executables 90 | if ( scripts ) { 91 | j = 0; 92 | while ( ( elem = tmp[ j++ ] ) ) { 93 | if ( rscriptType.test( elem.type || "" ) ) { 94 | scripts.push( elem ); 95 | } 96 | } 97 | } 98 | } 99 | 100 | return fragment; 101 | } 102 | 103 | return buildFragment; 104 | } ); 105 | -------------------------------------------------------------------------------- /bower_components/jquery/src/core/ready-no-deferred.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../var/document" 4 | ], function( jQuery, document ) { 5 | 6 | "use strict"; 7 | 8 | var readyCallbacks = [], 9 | readyFiring = false, 10 | whenReady = function( fn ) { 11 | readyCallbacks.push( fn ); 12 | }, 13 | executeReady = function( fn ) { 14 | 15 | // Prevent errors from freezing future callback execution (gh-1823) 16 | // Not backwards-compatible as this does not execute sync 17 | window.setTimeout( function() { 18 | fn.call( document, jQuery ); 19 | } ); 20 | }; 21 | 22 | jQuery.fn.ready = function( fn ) { 23 | whenReady( fn ); 24 | return this; 25 | }; 26 | 27 | jQuery.extend( { 28 | 29 | // Is the DOM ready to be used? Set to true once it occurs. 30 | isReady: false, 31 | 32 | // A counter to track how many items to wait for before 33 | // the ready event fires. See #6781 34 | readyWait: 1, 35 | 36 | // Hold (or release) the ready event 37 | holdReady: function( hold ) { 38 | if ( hold ) { 39 | jQuery.readyWait++; 40 | } else { 41 | jQuery.ready( true ); 42 | } 43 | }, 44 | 45 | ready: function( wait ) { 46 | 47 | // Abort if there are pending holds or we're already ready 48 | if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 49 | return; 50 | } 51 | 52 | // Remember that the DOM is ready 53 | jQuery.isReady = true; 54 | 55 | // If a normal DOM Ready event fired, decrement, and wait if need be 56 | if ( wait !== true && --jQuery.readyWait > 0 ) { 57 | return; 58 | } 59 | 60 | whenReady = function( fn ) { 61 | readyCallbacks.push( fn ); 62 | 63 | if ( !readyFiring ) { 64 | readyFiring = true; 65 | 66 | while ( readyCallbacks.length ) { 67 | fn = readyCallbacks.shift(); 68 | if ( jQuery.isFunction( fn ) ) { 69 | executeReady( fn ); 70 | } 71 | } 72 | readyFiring = false; 73 | } 74 | }; 75 | 76 | whenReady(); 77 | } 78 | } ); 79 | 80 | // Make jQuery.ready Promise consumable (gh-1778) 81 | jQuery.ready.then = jQuery.fn.ready; 82 | 83 | /** 84 | * The ready event handler and self cleanup method 85 | */ 86 | function completed() { 87 | document.removeEventListener( "DOMContentLoaded", completed ); 88 | window.removeEventListener( "load", completed ); 89 | jQuery.ready(); 90 | } 91 | 92 | // Catch cases where $(document).ready() is called 93 | // after the browser event has already occurred. 94 | // Support: IE9-10 only 95 | // Older IE sometimes signals "interactive" too soon 96 | if ( document.readyState === "complete" || 97 | ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 98 | 99 | // Handle it asynchronously to allow scripts the opportunity to delay ready 100 | window.setTimeout( jQuery.ready ); 101 | 102 | } else { 103 | 104 | // Use the handy event callback 105 | document.addEventListener( "DOMContentLoaded", completed ); 106 | 107 | // A fallback to window.onload, that will always work 108 | window.addEventListener( "load", completed ); 109 | } 110 | 111 | } ); 112 | -------------------------------------------------------------------------------- /bower_components/jquery/src/ajax/jsonp.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "./var/nonce", 4 | "./var/rquery", 5 | "../ajax" 6 | ], function( jQuery, nonce, rquery ) { 7 | 8 | "use strict"; 9 | 10 | var oldCallbacks = [], 11 | rjsonp = /(=)\?(?=&|$)|\?\?/; 12 | 13 | // Default jsonp settings 14 | jQuery.ajaxSetup( { 15 | jsonp: "callback", 16 | jsonpCallback: function() { 17 | var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); 18 | this[ callback ] = true; 19 | return callback; 20 | } 21 | } ); 22 | 23 | // Detect, normalize options and install callbacks for jsonp requests 24 | jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 25 | 26 | var callbackName, overwritten, responseContainer, 27 | jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 28 | "url" : 29 | typeof s.data === "string" && 30 | ( s.contentType || "" ) 31 | .indexOf( "application/x-www-form-urlencoded" ) === 0 && 32 | rjsonp.test( s.data ) && "data" 33 | ); 34 | 35 | // Handle iff the expected data type is "jsonp" or we have a parameter to set 36 | if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 37 | 38 | // Get callback name, remembering preexisting value associated with it 39 | callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? 40 | s.jsonpCallback() : 41 | s.jsonpCallback; 42 | 43 | // Insert callback into url or form data 44 | if ( jsonProp ) { 45 | s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 46 | } else if ( s.jsonp !== false ) { 47 | s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 48 | } 49 | 50 | // Use data converter to retrieve json after script execution 51 | s.converters[ "script json" ] = function() { 52 | if ( !responseContainer ) { 53 | jQuery.error( callbackName + " was not called" ); 54 | } 55 | return responseContainer[ 0 ]; 56 | }; 57 | 58 | // Force json dataType 59 | s.dataTypes[ 0 ] = "json"; 60 | 61 | // Install callback 62 | overwritten = window[ callbackName ]; 63 | window[ callbackName ] = function() { 64 | responseContainer = arguments; 65 | }; 66 | 67 | // Clean-up function (fires after converters) 68 | jqXHR.always( function() { 69 | 70 | // If previous value didn't exist - remove it 71 | if ( overwritten === undefined ) { 72 | jQuery( window ).removeProp( callbackName ); 73 | 74 | // Otherwise restore preexisting value 75 | } else { 76 | window[ callbackName ] = overwritten; 77 | } 78 | 79 | // Save back as free 80 | if ( s[ callbackName ] ) { 81 | 82 | // Make sure that re-using the options doesn't screw things around 83 | s.jsonpCallback = originalSettings.jsonpCallback; 84 | 85 | // Save the callback name for future use 86 | oldCallbacks.push( callbackName ); 87 | } 88 | 89 | // Call if it was a function and we have a response 90 | if ( responseContainer && jQuery.isFunction( overwritten ) ) { 91 | overwritten( responseContainer[ 0 ] ); 92 | } 93 | 94 | responseContainer = overwritten = undefined; 95 | } ); 96 | 97 | // Delegate to script 98 | return "script"; 99 | } 100 | } ); 101 | 102 | } ); 103 | -------------------------------------------------------------------------------- /bower_components/jquery/src/attributes/prop.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../core/access", 4 | "./support", 5 | "../selector" 6 | ], function( jQuery, access, support ) { 7 | 8 | "use strict"; 9 | 10 | var rfocusable = /^(?:input|select|textarea|button)$/i, 11 | rclickable = /^(?:a|area)$/i; 12 | 13 | jQuery.fn.extend( { 14 | prop: function( name, value ) { 15 | return access( this, jQuery.prop, name, value, arguments.length > 1 ); 16 | }, 17 | 18 | removeProp: function( name ) { 19 | return this.each( function() { 20 | delete this[ jQuery.propFix[ name ] || name ]; 21 | } ); 22 | } 23 | } ); 24 | 25 | jQuery.extend( { 26 | prop: function( elem, name, value ) { 27 | var ret, hooks, 28 | nType = elem.nodeType; 29 | 30 | // Don't get/set properties on text, comment and attribute nodes 31 | if ( nType === 3 || nType === 8 || nType === 2 ) { 32 | return; 33 | } 34 | 35 | if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 36 | 37 | // Fix name and attach hooks 38 | name = jQuery.propFix[ name ] || name; 39 | hooks = jQuery.propHooks[ name ]; 40 | } 41 | 42 | if ( value !== undefined ) { 43 | if ( hooks && "set" in hooks && 44 | ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 45 | return ret; 46 | } 47 | 48 | return ( elem[ name ] = value ); 49 | } 50 | 51 | if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 52 | return ret; 53 | } 54 | 55 | return elem[ name ]; 56 | }, 57 | 58 | propHooks: { 59 | tabIndex: { 60 | get: function( elem ) { 61 | 62 | // Support: IE <=9 - 11 only 63 | // elem.tabIndex doesn't always return the 64 | // correct value when it hasn't been explicitly set 65 | // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 66 | // Use proper attribute retrieval(#12072) 67 | var tabindex = jQuery.find.attr( elem, "tabindex" ); 68 | 69 | return tabindex ? 70 | parseInt( tabindex, 10 ) : 71 | rfocusable.test( elem.nodeName ) || 72 | rclickable.test( elem.nodeName ) && elem.href ? 73 | 0 : 74 | -1; 75 | } 76 | } 77 | }, 78 | 79 | propFix: { 80 | "for": "htmlFor", 81 | "class": "className" 82 | } 83 | } ); 84 | 85 | // Support: IE <=11 only 86 | // Accessing the selectedIndex property 87 | // forces the browser to respect setting selected 88 | // on the option 89 | // The getter ensures a default option is selected 90 | // when in an optgroup 91 | if ( !support.optSelected ) { 92 | jQuery.propHooks.selected = { 93 | get: function( elem ) { 94 | var parent = elem.parentNode; 95 | if ( parent && parent.parentNode ) { 96 | parent.parentNode.selectedIndex; 97 | } 98 | return null; 99 | }, 100 | set: function( elem ) { 101 | var parent = elem.parentNode; 102 | if ( parent ) { 103 | parent.selectedIndex; 104 | 105 | if ( parent.parentNode ) { 106 | parent.parentNode.selectedIndex; 107 | } 108 | } 109 | } 110 | }; 111 | } 112 | 113 | jQuery.each( [ 114 | "tabIndex", 115 | "readOnly", 116 | "maxLength", 117 | "cellSpacing", 118 | "cellPadding", 119 | "rowSpan", 120 | "colSpan", 121 | "useMap", 122 | "frameBorder", 123 | "contentEditable" 124 | ], function() { 125 | jQuery.propFix[ this.toLowerCase() ] = this; 126 | } ); 127 | 128 | } ); 129 | -------------------------------------------------------------------------------- /bower_components/jquery/src/serialize.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./core", 3 | "./manipulation/var/rcheckableType", 4 | "./core/init", 5 | "./traversing", // filter 6 | "./attributes/prop" 7 | ], function( jQuery, rcheckableType ) { 8 | 9 | "use strict"; 10 | 11 | var 12 | rbracket = /\[\]$/, 13 | rCRLF = /\r?\n/g, 14 | rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 15 | rsubmittable = /^(?:input|select|textarea|keygen)/i; 16 | 17 | function buildParams( prefix, obj, traditional, add ) { 18 | var name; 19 | 20 | if ( jQuery.isArray( obj ) ) { 21 | 22 | // Serialize array item. 23 | jQuery.each( obj, function( i, v ) { 24 | if ( traditional || rbracket.test( prefix ) ) { 25 | 26 | // Treat each array item as a scalar. 27 | add( prefix, v ); 28 | 29 | } else { 30 | 31 | // Item is non-scalar (array or object), encode its numeric index. 32 | buildParams( 33 | prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 34 | v, 35 | traditional, 36 | add 37 | ); 38 | } 39 | } ); 40 | 41 | } else if ( !traditional && jQuery.type( obj ) === "object" ) { 42 | 43 | // Serialize object item. 44 | for ( name in obj ) { 45 | buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 46 | } 47 | 48 | } else { 49 | 50 | // Serialize scalar item. 51 | add( prefix, obj ); 52 | } 53 | } 54 | 55 | // Serialize an array of form elements or a set of 56 | // key/values into a query string 57 | jQuery.param = function( a, traditional ) { 58 | var prefix, 59 | s = [], 60 | add = function( key, valueOrFunction ) { 61 | 62 | // If value is a function, invoke it and use its return value 63 | var value = jQuery.isFunction( valueOrFunction ) ? 64 | valueOrFunction() : 65 | valueOrFunction; 66 | 67 | s[ s.length ] = encodeURIComponent( key ) + "=" + 68 | encodeURIComponent( value == null ? "" : value ); 69 | }; 70 | 71 | // If an array was passed in, assume that it is an array of form elements. 72 | if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 73 | 74 | // Serialize the form elements 75 | jQuery.each( a, function() { 76 | add( this.name, this.value ); 77 | } ); 78 | 79 | } else { 80 | 81 | // If traditional, encode the "old" way (the way 1.3.2 or older 82 | // did it), otherwise encode params recursively. 83 | for ( prefix in a ) { 84 | buildParams( prefix, a[ prefix ], traditional, add ); 85 | } 86 | } 87 | 88 | // Return the resulting serialization 89 | return s.join( "&" ); 90 | }; 91 | 92 | jQuery.fn.extend( { 93 | serialize: function() { 94 | return jQuery.param( this.serializeArray() ); 95 | }, 96 | serializeArray: function() { 97 | return this.map( function() { 98 | 99 | // Can add propHook for "elements" to filter or add form elements 100 | var elements = jQuery.prop( this, "elements" ); 101 | return elements ? jQuery.makeArray( elements ) : this; 102 | } ) 103 | .filter( function() { 104 | var type = this.type; 105 | 106 | // Use .is( ":disabled" ) so that fieldset[disabled] works 107 | return this.name && !jQuery( this ).is( ":disabled" ) && 108 | rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 109 | ( this.checked || !rcheckableType.test( type ) ); 110 | } ) 111 | .map( function( i, elem ) { 112 | var val = jQuery( this ).val(); 113 | 114 | return val == null ? 115 | null : 116 | jQuery.isArray( val ) ? 117 | jQuery.map( val, function( val ) { 118 | return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 119 | } ) : 120 | { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 121 | } ).get(); 122 | } 123 | } ); 124 | 125 | return jQuery; 126 | } ); 127 | -------------------------------------------------------------------------------- /bower_components/jquery/src/attributes/attr.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../core/access", 4 | "./support", 5 | "../var/rnotwhite", 6 | "../selector" 7 | ], function( jQuery, access, support, rnotwhite ) { 8 | 9 | "use strict"; 10 | 11 | var boolHook, 12 | attrHandle = jQuery.expr.attrHandle; 13 | 14 | jQuery.fn.extend( { 15 | attr: function( name, value ) { 16 | return access( this, jQuery.attr, name, value, arguments.length > 1 ); 17 | }, 18 | 19 | removeAttr: function( name ) { 20 | return this.each( function() { 21 | jQuery.removeAttr( this, name ); 22 | } ); 23 | } 24 | } ); 25 | 26 | jQuery.extend( { 27 | attr: function( elem, name, value ) { 28 | var ret, hooks, 29 | nType = elem.nodeType; 30 | 31 | // Don't get/set attributes on text, comment and attribute nodes 32 | if ( nType === 3 || nType === 8 || nType === 2 ) { 33 | return; 34 | } 35 | 36 | // Fallback to prop when attributes are not supported 37 | if ( typeof elem.getAttribute === "undefined" ) { 38 | return jQuery.prop( elem, name, value ); 39 | } 40 | 41 | // Attribute hooks are determined by the lowercase version 42 | // Grab necessary hook if one is defined 43 | if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 44 | hooks = jQuery.attrHooks[ name.toLowerCase() ] || 45 | ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); 46 | } 47 | 48 | if ( value !== undefined ) { 49 | if ( value === null ) { 50 | jQuery.removeAttr( elem, name ); 51 | return; 52 | } 53 | 54 | if ( hooks && "set" in hooks && 55 | ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 56 | return ret; 57 | } 58 | 59 | elem.setAttribute( name, value + "" ); 60 | return value; 61 | } 62 | 63 | if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 64 | return ret; 65 | } 66 | 67 | ret = jQuery.find.attr( elem, name ); 68 | 69 | // Non-existent attributes return null, we normalize to undefined 70 | return ret == null ? undefined : ret; 71 | }, 72 | 73 | attrHooks: { 74 | type: { 75 | set: function( elem, value ) { 76 | if ( !support.radioValue && value === "radio" && 77 | jQuery.nodeName( elem, "input" ) ) { 78 | var val = elem.value; 79 | elem.setAttribute( "type", value ); 80 | if ( val ) { 81 | elem.value = val; 82 | } 83 | return value; 84 | } 85 | } 86 | } 87 | }, 88 | 89 | removeAttr: function( elem, value ) { 90 | var name, 91 | i = 0, 92 | attrNames = value && value.match( rnotwhite ); 93 | 94 | if ( attrNames && elem.nodeType === 1 ) { 95 | while ( ( name = attrNames[ i++ ] ) ) { 96 | elem.removeAttribute( name ); 97 | } 98 | } 99 | } 100 | } ); 101 | 102 | // Hooks for boolean attributes 103 | boolHook = { 104 | set: function( elem, value, name ) { 105 | if ( value === false ) { 106 | 107 | // Remove boolean attributes when set to false 108 | jQuery.removeAttr( elem, name ); 109 | } else { 110 | elem.setAttribute( name, name ); 111 | } 112 | return name; 113 | } 114 | }; 115 | 116 | jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { 117 | var getter = attrHandle[ name ] || jQuery.find.attr; 118 | 119 | attrHandle[ name ] = function( elem, name, isXML ) { 120 | var ret, handle, 121 | lowercaseName = name.toLowerCase(); 122 | 123 | if ( !isXML ) { 124 | 125 | // Avoid an infinite loop by temporarily removing this function from the getter 126 | handle = attrHandle[ lowercaseName ]; 127 | attrHandle[ lowercaseName ] = ret; 128 | ret = getter( elem, name, isXML ) != null ? 129 | lowercaseName : 130 | null; 131 | attrHandle[ lowercaseName ] = handle; 132 | } 133 | return ret; 134 | }; 135 | } ); 136 | 137 | } ); 138 | -------------------------------------------------------------------------------- /bower_components/jquery/src/queue.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./core", 3 | "./data/var/dataPriv", 4 | "./deferred", 5 | "./callbacks" 6 | ], function( jQuery, dataPriv ) { 7 | 8 | "use strict"; 9 | 10 | jQuery.extend( { 11 | queue: function( elem, type, data ) { 12 | var queue; 13 | 14 | if ( elem ) { 15 | type = ( type || "fx" ) + "queue"; 16 | queue = dataPriv.get( elem, type ); 17 | 18 | // Speed up dequeue by getting out quickly if this is just a lookup 19 | if ( data ) { 20 | if ( !queue || jQuery.isArray( data ) ) { 21 | queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); 22 | } else { 23 | queue.push( data ); 24 | } 25 | } 26 | return queue || []; 27 | } 28 | }, 29 | 30 | dequeue: function( elem, type ) { 31 | type = type || "fx"; 32 | 33 | var queue = jQuery.queue( elem, type ), 34 | startLength = queue.length, 35 | fn = queue.shift(), 36 | hooks = jQuery._queueHooks( elem, type ), 37 | next = function() { 38 | jQuery.dequeue( elem, type ); 39 | }; 40 | 41 | // If the fx queue is dequeued, always remove the progress sentinel 42 | if ( fn === "inprogress" ) { 43 | fn = queue.shift(); 44 | startLength--; 45 | } 46 | 47 | if ( fn ) { 48 | 49 | // Add a progress sentinel to prevent the fx queue from being 50 | // automatically dequeued 51 | if ( type === "fx" ) { 52 | queue.unshift( "inprogress" ); 53 | } 54 | 55 | // Clear up the last queue stop function 56 | delete hooks.stop; 57 | fn.call( elem, next, hooks ); 58 | } 59 | 60 | if ( !startLength && hooks ) { 61 | hooks.empty.fire(); 62 | } 63 | }, 64 | 65 | // Not public - generate a queueHooks object, or return the current one 66 | _queueHooks: function( elem, type ) { 67 | var key = type + "queueHooks"; 68 | return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { 69 | empty: jQuery.Callbacks( "once memory" ).add( function() { 70 | dataPriv.remove( elem, [ type + "queue", key ] ); 71 | } ) 72 | } ); 73 | } 74 | } ); 75 | 76 | jQuery.fn.extend( { 77 | queue: function( type, data ) { 78 | var setter = 2; 79 | 80 | if ( typeof type !== "string" ) { 81 | data = type; 82 | type = "fx"; 83 | setter--; 84 | } 85 | 86 | if ( arguments.length < setter ) { 87 | return jQuery.queue( this[ 0 ], type ); 88 | } 89 | 90 | return data === undefined ? 91 | this : 92 | this.each( function() { 93 | var queue = jQuery.queue( this, type, data ); 94 | 95 | // Ensure a hooks for this queue 96 | jQuery._queueHooks( this, type ); 97 | 98 | if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 99 | jQuery.dequeue( this, type ); 100 | } 101 | } ); 102 | }, 103 | dequeue: function( type ) { 104 | return this.each( function() { 105 | jQuery.dequeue( this, type ); 106 | } ); 107 | }, 108 | clearQueue: function( type ) { 109 | return this.queue( type || "fx", [] ); 110 | }, 111 | 112 | // Get a promise resolved when queues of a certain type 113 | // are emptied (fx is the type by default) 114 | promise: function( type, obj ) { 115 | var tmp, 116 | count = 1, 117 | defer = jQuery.Deferred(), 118 | elements = this, 119 | i = this.length, 120 | resolve = function() { 121 | if ( !( --count ) ) { 122 | defer.resolveWith( elements, [ elements ] ); 123 | } 124 | }; 125 | 126 | if ( typeof type !== "string" ) { 127 | obj = type; 128 | type = undefined; 129 | } 130 | type = type || "fx"; 131 | 132 | while ( i-- ) { 133 | tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); 134 | if ( tmp && tmp.empty ) { 135 | count++; 136 | tmp.empty.add( resolve ); 137 | } 138 | } 139 | resolve(); 140 | return defer.promise( obj ); 141 | } 142 | } ); 143 | 144 | return jQuery; 145 | } ); 146 | -------------------------------------------------------------------------------- /bower_components/jquery/src/effects/Tween.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../css" 4 | ], function( jQuery ) { 5 | 6 | "use strict"; 7 | 8 | function Tween( elem, options, prop, end, easing ) { 9 | return new Tween.prototype.init( elem, options, prop, end, easing ); 10 | } 11 | jQuery.Tween = Tween; 12 | 13 | Tween.prototype = { 14 | constructor: Tween, 15 | init: function( elem, options, prop, end, easing, unit ) { 16 | this.elem = elem; 17 | this.prop = prop; 18 | this.easing = easing || jQuery.easing._default; 19 | this.options = options; 20 | this.start = this.now = this.cur(); 21 | this.end = end; 22 | this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 23 | }, 24 | cur: function() { 25 | var hooks = Tween.propHooks[ this.prop ]; 26 | 27 | return hooks && hooks.get ? 28 | hooks.get( this ) : 29 | Tween.propHooks._default.get( this ); 30 | }, 31 | run: function( percent ) { 32 | var eased, 33 | hooks = Tween.propHooks[ this.prop ]; 34 | 35 | if ( this.options.duration ) { 36 | this.pos = eased = jQuery.easing[ this.easing ]( 37 | percent, this.options.duration * percent, 0, 1, this.options.duration 38 | ); 39 | } else { 40 | this.pos = eased = percent; 41 | } 42 | this.now = ( this.end - this.start ) * eased + this.start; 43 | 44 | if ( this.options.step ) { 45 | this.options.step.call( this.elem, this.now, this ); 46 | } 47 | 48 | if ( hooks && hooks.set ) { 49 | hooks.set( this ); 50 | } else { 51 | Tween.propHooks._default.set( this ); 52 | } 53 | return this; 54 | } 55 | }; 56 | 57 | Tween.prototype.init.prototype = Tween.prototype; 58 | 59 | Tween.propHooks = { 60 | _default: { 61 | get: function( tween ) { 62 | var result; 63 | 64 | // Use a property on the element directly when it is not a DOM element, 65 | // or when there is no matching style property that exists. 66 | if ( tween.elem.nodeType !== 1 || 67 | tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 68 | return tween.elem[ tween.prop ]; 69 | } 70 | 71 | // Passing an empty string as a 3rd parameter to .css will automatically 72 | // attempt a parseFloat and fallback to a string if the parse fails. 73 | // Simple values such as "10px" are parsed to Float; 74 | // complex values such as "rotate(1rad)" are returned as-is. 75 | result = jQuery.css( tween.elem, tween.prop, "" ); 76 | 77 | // Empty strings, null, undefined and "auto" are converted to 0. 78 | return !result || result === "auto" ? 0 : result; 79 | }, 80 | set: function( tween ) { 81 | 82 | // Use step hook for back compat. 83 | // Use cssHook if its there. 84 | // Use .style if available and use plain properties where available. 85 | if ( jQuery.fx.step[ tween.prop ] ) { 86 | jQuery.fx.step[ tween.prop ]( tween ); 87 | } else if ( tween.elem.nodeType === 1 && 88 | ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || 89 | jQuery.cssHooks[ tween.prop ] ) ) { 90 | jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 91 | } else { 92 | tween.elem[ tween.prop ] = tween.now; 93 | } 94 | } 95 | } 96 | }; 97 | 98 | // Support: IE <=9 only 99 | // Panic based approach to setting things on disconnected nodes 100 | Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 101 | set: function( tween ) { 102 | if ( tween.elem.nodeType && tween.elem.parentNode ) { 103 | tween.elem[ tween.prop ] = tween.now; 104 | } 105 | } 106 | }; 107 | 108 | jQuery.easing = { 109 | linear: function( p ) { 110 | return p; 111 | }, 112 | swing: function( p ) { 113 | return 0.5 - Math.cos( p * Math.PI ) / 2; 114 | }, 115 | _default: "swing" 116 | }; 117 | 118 | jQuery.fx = Tween.prototype.init; 119 | 120 | // Back compat <1.8 extension point 121 | jQuery.fx.step = {}; 122 | 123 | } ); 124 | -------------------------------------------------------------------------------- /bower_components/jquery/src/core/init.js: -------------------------------------------------------------------------------- 1 | // Initialize a jQuery object 2 | define( [ 3 | "../core", 4 | "../var/document", 5 | "./var/rsingleTag", 6 | "../traversing/findFilter" 7 | ], function( jQuery, document, rsingleTag ) { 8 | 9 | "use strict"; 10 | 11 | // A central reference to the root jQuery(document) 12 | var rootjQuery, 13 | 14 | // A simple way to check for HTML strings 15 | // Prioritize #id over to avoid XSS via location.hash (#9521) 16 | // Strict HTML recognition (#11290: must start with <) 17 | // Shortcut simple #id case for speed 18 | rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, 19 | 20 | init = jQuery.fn.init = function( selector, context, root ) { 21 | var match, elem; 22 | 23 | // HANDLE: $(""), $(null), $(undefined), $(false) 24 | if ( !selector ) { 25 | return this; 26 | } 27 | 28 | // Method init() accepts an alternate rootjQuery 29 | // so migrate can support jQuery.sub (gh-2101) 30 | root = root || rootjQuery; 31 | 32 | // Handle HTML strings 33 | if ( typeof selector === "string" ) { 34 | if ( selector[ 0 ] === "<" && 35 | selector[ selector.length - 1 ] === ">" && 36 | selector.length >= 3 ) { 37 | 38 | // Assume that strings that start and end with <> are HTML and skip the regex check 39 | match = [ null, selector, null ]; 40 | 41 | } else { 42 | match = rquickExpr.exec( selector ); 43 | } 44 | 45 | // Match html or make sure no context is specified for #id 46 | if ( match && ( match[ 1 ] || !context ) ) { 47 | 48 | // HANDLE: $(html) -> $(array) 49 | if ( match[ 1 ] ) { 50 | context = context instanceof jQuery ? context[ 0 ] : context; 51 | 52 | // Option to run scripts is true for back-compat 53 | // Intentionally let the error be thrown if parseHTML is not present 54 | jQuery.merge( this, jQuery.parseHTML( 55 | match[ 1 ], 56 | context && context.nodeType ? context.ownerDocument || context : document, 57 | true 58 | ) ); 59 | 60 | // HANDLE: $(html, props) 61 | if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 62 | for ( match in context ) { 63 | 64 | // Properties of context are called as methods if possible 65 | if ( jQuery.isFunction( this[ match ] ) ) { 66 | this[ match ]( context[ match ] ); 67 | 68 | // ...and otherwise set as attributes 69 | } else { 70 | this.attr( match, context[ match ] ); 71 | } 72 | } 73 | } 74 | 75 | return this; 76 | 77 | // HANDLE: $(#id) 78 | } else { 79 | elem = document.getElementById( match[ 2 ] ); 80 | 81 | if ( elem ) { 82 | 83 | // Inject the element directly into the jQuery object 84 | this[ 0 ] = elem; 85 | this.length = 1; 86 | } 87 | return this; 88 | } 89 | 90 | // HANDLE: $(expr, $(...)) 91 | } else if ( !context || context.jquery ) { 92 | return ( context || root ).find( selector ); 93 | 94 | // HANDLE: $(expr, context) 95 | // (which is just equivalent to: $(context).find(expr) 96 | } else { 97 | return this.constructor( context ).find( selector ); 98 | } 99 | 100 | // HANDLE: $(DOMElement) 101 | } else if ( selector.nodeType ) { 102 | this[ 0 ] = selector; 103 | this.length = 1; 104 | return this; 105 | 106 | // HANDLE: $(function) 107 | // Shortcut for document ready 108 | } else if ( jQuery.isFunction( selector ) ) { 109 | return root.ready !== undefined ? 110 | root.ready( selector ) : 111 | 112 | // Execute immediately if ready is not present 113 | selector( jQuery ); 114 | } 115 | 116 | return jQuery.makeArray( selector, this ); 117 | }; 118 | 119 | // Give the init function the jQuery prototype for later instantiation 120 | init.prototype = jQuery.fn; 121 | 122 | // Initialize central reference 123 | rootjQuery = jQuery( document ); 124 | 125 | return init; 126 | 127 | } ); 128 | -------------------------------------------------------------------------------- /bower_components/jquery/src/data/Data.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../var/rnotwhite", 4 | "./var/acceptData" 5 | ], function( jQuery, rnotwhite, acceptData ) { 6 | 7 | "use strict"; 8 | 9 | function Data() { 10 | this.expando = jQuery.expando + Data.uid++; 11 | } 12 | 13 | Data.uid = 1; 14 | 15 | Data.prototype = { 16 | 17 | cache: function( owner ) { 18 | 19 | // Check if the owner object already has a cache 20 | var value = owner[ this.expando ]; 21 | 22 | // If not, create one 23 | if ( !value ) { 24 | value = {}; 25 | 26 | // We can accept data for non-element nodes in modern browsers, 27 | // but we should not, see #8335. 28 | // Always return an empty object. 29 | if ( acceptData( owner ) ) { 30 | 31 | // If it is a node unlikely to be stringify-ed or looped over 32 | // use plain assignment 33 | if ( owner.nodeType ) { 34 | owner[ this.expando ] = value; 35 | 36 | // Otherwise secure it in a non-enumerable property 37 | // configurable must be true to allow the property to be 38 | // deleted when data is removed 39 | } else { 40 | Object.defineProperty( owner, this.expando, { 41 | value: value, 42 | configurable: true 43 | } ); 44 | } 45 | } 46 | } 47 | 48 | return value; 49 | }, 50 | set: function( owner, data, value ) { 51 | var prop, 52 | cache = this.cache( owner ); 53 | 54 | // Handle: [ owner, key, value ] args 55 | // Always use camelCase key (gh-2257) 56 | if ( typeof data === "string" ) { 57 | cache[ jQuery.camelCase( data ) ] = value; 58 | 59 | // Handle: [ owner, { properties } ] args 60 | } else { 61 | 62 | // Copy the properties one-by-one to the cache object 63 | for ( prop in data ) { 64 | cache[ jQuery.camelCase( prop ) ] = data[ prop ]; 65 | } 66 | } 67 | return cache; 68 | }, 69 | get: function( owner, key ) { 70 | return key === undefined ? 71 | this.cache( owner ) : 72 | 73 | // Always use camelCase key (gh-2257) 74 | owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ]; 75 | }, 76 | access: function( owner, key, value ) { 77 | 78 | // In cases where either: 79 | // 80 | // 1. No key was specified 81 | // 2. A string key was specified, but no value provided 82 | // 83 | // Take the "read" path and allow the get method to determine 84 | // which value to return, respectively either: 85 | // 86 | // 1. The entire cache object 87 | // 2. The data stored at the key 88 | // 89 | if ( key === undefined || 90 | ( ( key && typeof key === "string" ) && value === undefined ) ) { 91 | 92 | return this.get( owner, key ); 93 | } 94 | 95 | // When the key is not a string, or both a key and value 96 | // are specified, set or extend (existing objects) with either: 97 | // 98 | // 1. An object of properties 99 | // 2. A key and value 100 | // 101 | this.set( owner, key, value ); 102 | 103 | // Since the "set" path can have two possible entry points 104 | // return the expected data based on which path was taken[*] 105 | return value !== undefined ? value : key; 106 | }, 107 | remove: function( owner, key ) { 108 | var i, 109 | cache = owner[ this.expando ]; 110 | 111 | if ( cache === undefined ) { 112 | return; 113 | } 114 | 115 | if ( key !== undefined ) { 116 | 117 | // Support array or space separated string of keys 118 | if ( jQuery.isArray( key ) ) { 119 | 120 | // If key is an array of keys... 121 | // We always set camelCase keys, so remove that. 122 | key = key.map( jQuery.camelCase ); 123 | } else { 124 | key = jQuery.camelCase( key ); 125 | 126 | // If a key with the spaces exists, use it. 127 | // Otherwise, create an array by matching non-whitespace 128 | key = key in cache ? 129 | [ key ] : 130 | ( key.match( rnotwhite ) || [] ); 131 | } 132 | 133 | i = key.length; 134 | 135 | while ( i-- ) { 136 | delete cache[ key[ i ] ]; 137 | } 138 | } 139 | 140 | // Remove the expando if there's no more data 141 | if ( key === undefined || jQuery.isEmptyObject( cache ) ) { 142 | 143 | // Support: Chrome <=35 - 45 144 | // Webkit & Blink performance suffers when deleting properties 145 | // from DOM nodes, so set to undefined instead 146 | // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) 147 | if ( owner.nodeType ) { 148 | owner[ this.expando ] = undefined; 149 | } else { 150 | delete owner[ this.expando ]; 151 | } 152 | } 153 | }, 154 | hasData: function( owner ) { 155 | var cache = owner[ this.expando ]; 156 | return cache !== undefined && !jQuery.isEmptyObject( cache ); 157 | } 158 | }; 159 | 160 | return Data; 161 | } ); 162 | -------------------------------------------------------------------------------- /bower_components/jquery/src/data.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./core", 3 | "./core/access", 4 | "./data/var/dataPriv", 5 | "./data/var/dataUser" 6 | ], function( jQuery, access, dataPriv, dataUser ) { 7 | 8 | "use strict"; 9 | 10 | // Implementation Summary 11 | // 12 | // 1. Enforce API surface and semantic compatibility with 1.9.x branch 13 | // 2. Improve the module's maintainability by reducing the storage 14 | // paths to a single mechanism. 15 | // 3. Use the same single mechanism to support "private" and "user" data. 16 | // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 17 | // 5. Avoid exposing implementation details on user objects (eg. expando properties) 18 | // 6. Provide a clear path for implementation upgrade to WeakMap in 2014 19 | 20 | var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 21 | rmultiDash = /[A-Z]/g; 22 | 23 | function dataAttr( elem, key, data ) { 24 | var name; 25 | 26 | // If nothing was found internally, try to fetch any 27 | // data from the HTML5 data-* attribute 28 | if ( data === undefined && elem.nodeType === 1 ) { 29 | name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); 30 | data = elem.getAttribute( name ); 31 | 32 | if ( typeof data === "string" ) { 33 | try { 34 | data = data === "true" ? true : 35 | data === "false" ? false : 36 | data === "null" ? null : 37 | 38 | // Only convert to a number if it doesn't change the string 39 | +data + "" === data ? +data : 40 | rbrace.test( data ) ? JSON.parse( data ) : 41 | data; 42 | } catch ( e ) {} 43 | 44 | // Make sure we set the data so it isn't changed later 45 | dataUser.set( elem, key, data ); 46 | } else { 47 | data = undefined; 48 | } 49 | } 50 | return data; 51 | } 52 | 53 | jQuery.extend( { 54 | hasData: function( elem ) { 55 | return dataUser.hasData( elem ) || dataPriv.hasData( elem ); 56 | }, 57 | 58 | data: function( elem, name, data ) { 59 | return dataUser.access( elem, name, data ); 60 | }, 61 | 62 | removeData: function( elem, name ) { 63 | dataUser.remove( elem, name ); 64 | }, 65 | 66 | // TODO: Now that all calls to _data and _removeData have been replaced 67 | // with direct calls to dataPriv methods, these can be deprecated. 68 | _data: function( elem, name, data ) { 69 | return dataPriv.access( elem, name, data ); 70 | }, 71 | 72 | _removeData: function( elem, name ) { 73 | dataPriv.remove( elem, name ); 74 | } 75 | } ); 76 | 77 | jQuery.fn.extend( { 78 | data: function( key, value ) { 79 | var i, name, data, 80 | elem = this[ 0 ], 81 | attrs = elem && elem.attributes; 82 | 83 | // Gets all values 84 | if ( key === undefined ) { 85 | if ( this.length ) { 86 | data = dataUser.get( elem ); 87 | 88 | if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { 89 | i = attrs.length; 90 | while ( i-- ) { 91 | 92 | // Support: IE 11 only 93 | // The attrs elements can be null (#14894) 94 | if ( attrs[ i ] ) { 95 | name = attrs[ i ].name; 96 | if ( name.indexOf( "data-" ) === 0 ) { 97 | name = jQuery.camelCase( name.slice( 5 ) ); 98 | dataAttr( elem, name, data[ name ] ); 99 | } 100 | } 101 | } 102 | dataPriv.set( elem, "hasDataAttrs", true ); 103 | } 104 | } 105 | 106 | return data; 107 | } 108 | 109 | // Sets multiple values 110 | if ( typeof key === "object" ) { 111 | return this.each( function() { 112 | dataUser.set( this, key ); 113 | } ); 114 | } 115 | 116 | return access( this, function( value ) { 117 | var data; 118 | 119 | // The calling jQuery object (element matches) is not empty 120 | // (and therefore has an element appears at this[ 0 ]) and the 121 | // `value` parameter was not undefined. An empty jQuery object 122 | // will result in `undefined` for elem = this[ 0 ] which will 123 | // throw an exception if an attempt to read a data cache is made. 124 | if ( elem && value === undefined ) { 125 | 126 | // Attempt to get data from the cache 127 | // The key will always be camelCased in Data 128 | data = dataUser.get( elem, key ); 129 | if ( data !== undefined ) { 130 | return data; 131 | } 132 | 133 | // Attempt to "discover" the data in 134 | // HTML5 custom data-* attrs 135 | data = dataAttr( elem, key ); 136 | if ( data !== undefined ) { 137 | return data; 138 | } 139 | 140 | // We tried really hard, but the data doesn't exist. 141 | return; 142 | } 143 | 144 | // Set the data... 145 | this.each( function() { 146 | 147 | // We always store the camelCased key 148 | dataUser.set( this, key, value ); 149 | } ); 150 | }, null, value, arguments.length > 1, null, true ); 151 | }, 152 | 153 | removeData: function( key ) { 154 | return this.each( function() { 155 | dataUser.remove( this, key ); 156 | } ); 157 | } 158 | } ); 159 | 160 | return jQuery; 161 | } ); 162 | -------------------------------------------------------------------------------- /bower_components/jquery/src/traversing.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./core", 3 | "./var/indexOf", 4 | "./traversing/var/dir", 5 | "./traversing/var/siblings", 6 | "./traversing/var/rneedsContext", 7 | "./core/init", 8 | "./traversing/findFilter", 9 | "./selector" 10 | ], function( jQuery, indexOf, dir, siblings, rneedsContext ) { 11 | 12 | "use strict"; 13 | 14 | var rparentsprev = /^(?:parents|prev(?:Until|All))/, 15 | 16 | // Methods guaranteed to produce a unique set when starting from a unique set 17 | guaranteedUnique = { 18 | children: true, 19 | contents: true, 20 | next: true, 21 | prev: true 22 | }; 23 | 24 | jQuery.fn.extend( { 25 | has: function( target ) { 26 | var targets = jQuery( target, this ), 27 | l = targets.length; 28 | 29 | return this.filter( function() { 30 | var i = 0; 31 | for ( ; i < l; i++ ) { 32 | if ( jQuery.contains( this, targets[ i ] ) ) { 33 | return true; 34 | } 35 | } 36 | } ); 37 | }, 38 | 39 | closest: function( selectors, context ) { 40 | var cur, 41 | i = 0, 42 | l = this.length, 43 | matched = [], 44 | targets = typeof selectors !== "string" && jQuery( selectors ); 45 | 46 | // Positional selectors never match, since there's no _selection_ context 47 | if ( !rneedsContext.test( selectors ) ) { 48 | for ( ; i < l; i++ ) { 49 | for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 50 | 51 | // Always skip document fragments 52 | if ( cur.nodeType < 11 && ( targets ? 53 | targets.index( cur ) > -1 : 54 | 55 | // Don't pass non-elements to Sizzle 56 | cur.nodeType === 1 && 57 | jQuery.find.matchesSelector( cur, selectors ) ) ) { 58 | 59 | matched.push( cur ); 60 | break; 61 | } 62 | } 63 | } 64 | } 65 | 66 | return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 67 | }, 68 | 69 | // Determine the position of an element within the set 70 | index: function( elem ) { 71 | 72 | // No argument, return index in parent 73 | if ( !elem ) { 74 | return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 75 | } 76 | 77 | // Index in selector 78 | if ( typeof elem === "string" ) { 79 | return indexOf.call( jQuery( elem ), this[ 0 ] ); 80 | } 81 | 82 | // Locate the position of the desired element 83 | return indexOf.call( this, 84 | 85 | // If it receives a jQuery object, the first element is used 86 | elem.jquery ? elem[ 0 ] : elem 87 | ); 88 | }, 89 | 90 | add: function( selector, context ) { 91 | return this.pushStack( 92 | jQuery.uniqueSort( 93 | jQuery.merge( this.get(), jQuery( selector, context ) ) 94 | ) 95 | ); 96 | }, 97 | 98 | addBack: function( selector ) { 99 | return this.add( selector == null ? 100 | this.prevObject : this.prevObject.filter( selector ) 101 | ); 102 | } 103 | } ); 104 | 105 | function sibling( cur, dir ) { 106 | while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} 107 | return cur; 108 | } 109 | 110 | jQuery.each( { 111 | parent: function( elem ) { 112 | var parent = elem.parentNode; 113 | return parent && parent.nodeType !== 11 ? parent : null; 114 | }, 115 | parents: function( elem ) { 116 | return dir( elem, "parentNode" ); 117 | }, 118 | parentsUntil: function( elem, i, until ) { 119 | return dir( elem, "parentNode", until ); 120 | }, 121 | next: function( elem ) { 122 | return sibling( elem, "nextSibling" ); 123 | }, 124 | prev: function( elem ) { 125 | return sibling( elem, "previousSibling" ); 126 | }, 127 | nextAll: function( elem ) { 128 | return dir( elem, "nextSibling" ); 129 | }, 130 | prevAll: function( elem ) { 131 | return dir( elem, "previousSibling" ); 132 | }, 133 | nextUntil: function( elem, i, until ) { 134 | return dir( elem, "nextSibling", until ); 135 | }, 136 | prevUntil: function( elem, i, until ) { 137 | return dir( elem, "previousSibling", until ); 138 | }, 139 | siblings: function( elem ) { 140 | return siblings( ( elem.parentNode || {} ).firstChild, elem ); 141 | }, 142 | children: function( elem ) { 143 | return siblings( elem.firstChild ); 144 | }, 145 | contents: function( elem ) { 146 | return elem.contentDocument || jQuery.merge( [], elem.childNodes ); 147 | } 148 | }, function( name, fn ) { 149 | jQuery.fn[ name ] = function( until, selector ) { 150 | var matched = jQuery.map( this, fn, until ); 151 | 152 | if ( name.slice( -5 ) !== "Until" ) { 153 | selector = until; 154 | } 155 | 156 | if ( selector && typeof selector === "string" ) { 157 | matched = jQuery.filter( selector, matched ); 158 | } 159 | 160 | if ( this.length > 1 ) { 161 | 162 | // Remove duplicates 163 | if ( !guaranteedUnique[ name ] ) { 164 | jQuery.uniqueSort( matched ); 165 | } 166 | 167 | // Reverse order for parents* and prev-derivatives 168 | if ( rparentsprev.test( name ) ) { 169 | matched.reverse(); 170 | } 171 | } 172 | 173 | return this.pushStack( matched ); 174 | }; 175 | } ); 176 | 177 | return jQuery; 178 | } ); 179 | -------------------------------------------------------------------------------- /bower_components/jquery/src/attributes/val.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "./support", 4 | "../core/init" 5 | ], function( jQuery, support ) { 6 | 7 | "use strict"; 8 | 9 | var rreturn = /\r/g, 10 | rspaces = /[\x20\t\r\n\f]+/g; 11 | 12 | jQuery.fn.extend( { 13 | val: function( value ) { 14 | var hooks, ret, isFunction, 15 | elem = this[ 0 ]; 16 | 17 | if ( !arguments.length ) { 18 | if ( elem ) { 19 | hooks = jQuery.valHooks[ elem.type ] || 20 | jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 21 | 22 | if ( hooks && 23 | "get" in hooks && 24 | ( ret = hooks.get( elem, "value" ) ) !== undefined 25 | ) { 26 | return ret; 27 | } 28 | 29 | ret = elem.value; 30 | 31 | return typeof ret === "string" ? 32 | 33 | // Handle most common string cases 34 | ret.replace( rreturn, "" ) : 35 | 36 | // Handle cases where value is null/undef or number 37 | ret == null ? "" : ret; 38 | } 39 | 40 | return; 41 | } 42 | 43 | isFunction = jQuery.isFunction( value ); 44 | 45 | return this.each( function( i ) { 46 | var val; 47 | 48 | if ( this.nodeType !== 1 ) { 49 | return; 50 | } 51 | 52 | if ( isFunction ) { 53 | val = value.call( this, i, jQuery( this ).val() ); 54 | } else { 55 | val = value; 56 | } 57 | 58 | // Treat null/undefined as ""; convert numbers to string 59 | if ( val == null ) { 60 | val = ""; 61 | 62 | } else if ( typeof val === "number" ) { 63 | val += ""; 64 | 65 | } else if ( jQuery.isArray( val ) ) { 66 | val = jQuery.map( val, function( value ) { 67 | return value == null ? "" : value + ""; 68 | } ); 69 | } 70 | 71 | hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 72 | 73 | // If set returns undefined, fall back to normal setting 74 | if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 75 | this.value = val; 76 | } 77 | } ); 78 | } 79 | } ); 80 | 81 | jQuery.extend( { 82 | valHooks: { 83 | option: { 84 | get: function( elem ) { 85 | 86 | var val = jQuery.find.attr( elem, "value" ); 87 | return val != null ? 88 | val : 89 | 90 | // Support: IE <=10 - 11 only 91 | // option.text throws exceptions (#14686, #14858) 92 | // Strip and collapse whitespace 93 | // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 94 | jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " ); 95 | } 96 | }, 97 | select: { 98 | get: function( elem ) { 99 | var value, option, 100 | options = elem.options, 101 | index = elem.selectedIndex, 102 | one = elem.type === "select-one", 103 | values = one ? null : [], 104 | max = one ? index + 1 : options.length, 105 | i = index < 0 ? 106 | max : 107 | one ? index : 0; 108 | 109 | // Loop through all the selected options 110 | for ( ; i < max; i++ ) { 111 | option = options[ i ]; 112 | 113 | // Support: IE <=9 only 114 | // IE8-9 doesn't update selected after form reset (#2551) 115 | if ( ( option.selected || i === index ) && 116 | 117 | // Don't return options that are disabled or in a disabled optgroup 118 | !option.disabled && 119 | ( !option.parentNode.disabled || 120 | !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { 121 | 122 | // Get the specific value for the option 123 | value = jQuery( option ).val(); 124 | 125 | // We don't need an array for one selects 126 | if ( one ) { 127 | return value; 128 | } 129 | 130 | // Multi-Selects return an array 131 | values.push( value ); 132 | } 133 | } 134 | 135 | return values; 136 | }, 137 | 138 | set: function( elem, value ) { 139 | var optionSet, option, 140 | options = elem.options, 141 | values = jQuery.makeArray( value ), 142 | i = options.length; 143 | 144 | while ( i-- ) { 145 | option = options[ i ]; 146 | 147 | /* eslint-disable no-cond-assign */ 148 | 149 | if ( option.selected = 150 | jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 151 | ) { 152 | optionSet = true; 153 | } 154 | 155 | /* eslint-enable no-cond-assign */ 156 | } 157 | 158 | // Force browsers to behave consistently when non-matching value is set 159 | if ( !optionSet ) { 160 | elem.selectedIndex = -1; 161 | } 162 | return values; 163 | } 164 | } 165 | } 166 | } ); 167 | 168 | // Radios and checkboxes getter/setter 169 | jQuery.each( [ "radio", "checkbox" ], function() { 170 | jQuery.valHooks[ this ] = { 171 | set: function( elem, value ) { 172 | if ( jQuery.isArray( value ) ) { 173 | return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 174 | } 175 | } 176 | }; 177 | if ( !support.checkOn ) { 178 | jQuery.valHooks[ this ].get = function( elem ) { 179 | return elem.getAttribute( "value" ) === null ? "on" : elem.value; 180 | }; 181 | } 182 | } ); 183 | 184 | } ); 185 | -------------------------------------------------------------------------------- /bower_components/jquery/src/ajax/xhr.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../var/support", 4 | "../ajax" 5 | ], function( jQuery, support ) { 6 | 7 | "use strict"; 8 | 9 | jQuery.ajaxSettings.xhr = function() { 10 | try { 11 | return new window.XMLHttpRequest(); 12 | } catch ( e ) {} 13 | }; 14 | 15 | var xhrSuccessStatus = { 16 | 17 | // File protocol always yields status code 0, assume 200 18 | 0: 200, 19 | 20 | // Support: IE <=9 only 21 | // #1450: sometimes IE returns 1223 when it should be 204 22 | 1223: 204 23 | }, 24 | xhrSupported = jQuery.ajaxSettings.xhr(); 25 | 26 | support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 27 | support.ajax = xhrSupported = !!xhrSupported; 28 | 29 | jQuery.ajaxTransport( function( options ) { 30 | var callback, errorCallback; 31 | 32 | // Cross domain only allowed if supported through XMLHttpRequest 33 | if ( support.cors || xhrSupported && !options.crossDomain ) { 34 | return { 35 | send: function( headers, complete ) { 36 | var i, 37 | xhr = options.xhr(); 38 | 39 | xhr.open( 40 | options.type, 41 | options.url, 42 | options.async, 43 | options.username, 44 | options.password 45 | ); 46 | 47 | // Apply custom fields if provided 48 | if ( options.xhrFields ) { 49 | for ( i in options.xhrFields ) { 50 | xhr[ i ] = options.xhrFields[ i ]; 51 | } 52 | } 53 | 54 | // Override mime type if needed 55 | if ( options.mimeType && xhr.overrideMimeType ) { 56 | xhr.overrideMimeType( options.mimeType ); 57 | } 58 | 59 | // X-Requested-With header 60 | // For cross-domain requests, seeing as conditions for a preflight are 61 | // akin to a jigsaw puzzle, we simply never set it to be sure. 62 | // (it can always be set on a per-request basis or even using ajaxSetup) 63 | // For same-domain requests, won't change header if already provided. 64 | if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 65 | headers[ "X-Requested-With" ] = "XMLHttpRequest"; 66 | } 67 | 68 | // Set headers 69 | for ( i in headers ) { 70 | xhr.setRequestHeader( i, headers[ i ] ); 71 | } 72 | 73 | // Callback 74 | callback = function( type ) { 75 | return function() { 76 | if ( callback ) { 77 | callback = errorCallback = xhr.onload = 78 | xhr.onerror = xhr.onabort = xhr.onreadystatechange = null; 79 | 80 | if ( type === "abort" ) { 81 | xhr.abort(); 82 | } else if ( type === "error" ) { 83 | 84 | // Support: IE <=9 only 85 | // On a manual native abort, IE9 throws 86 | // errors on any property access that is not readyState 87 | if ( typeof xhr.status !== "number" ) { 88 | complete( 0, "error" ); 89 | } else { 90 | complete( 91 | 92 | // File: protocol always yields status 0; see #8605, #14207 93 | xhr.status, 94 | xhr.statusText 95 | ); 96 | } 97 | } else { 98 | complete( 99 | xhrSuccessStatus[ xhr.status ] || xhr.status, 100 | xhr.statusText, 101 | 102 | // Support: IE <=9 only 103 | // IE9 has no XHR2 but throws on binary (trac-11426) 104 | // For XHR2 non-text, let the caller handle it (gh-2498) 105 | ( xhr.responseType || "text" ) !== "text" || 106 | typeof xhr.responseText !== "string" ? 107 | { binary: xhr.response } : 108 | { text: xhr.responseText }, 109 | xhr.getAllResponseHeaders() 110 | ); 111 | } 112 | } 113 | }; 114 | }; 115 | 116 | // Listen to events 117 | xhr.onload = callback(); 118 | errorCallback = xhr.onerror = callback( "error" ); 119 | 120 | // Support: IE 9 only 121 | // Use onreadystatechange to replace onabort 122 | // to handle uncaught aborts 123 | if ( xhr.onabort !== undefined ) { 124 | xhr.onabort = errorCallback; 125 | } else { 126 | xhr.onreadystatechange = function() { 127 | 128 | // Check readyState before timeout as it changes 129 | if ( xhr.readyState === 4 ) { 130 | 131 | // Allow onerror to be called first, 132 | // but that will not handle a native abort 133 | // Also, save errorCallback to a variable 134 | // as xhr.onerror cannot be accessed 135 | window.setTimeout( function() { 136 | if ( callback ) { 137 | errorCallback(); 138 | } 139 | } ); 140 | } 141 | }; 142 | } 143 | 144 | // Create the abort callback 145 | callback = callback( "abort" ); 146 | 147 | try { 148 | 149 | // Do send the request (this may raise an exception) 150 | xhr.send( options.hasContent && options.data || null ); 151 | } catch ( e ) { 152 | 153 | // #14683: Only rethrow if this hasn't been notified as an error yet 154 | if ( callback ) { 155 | throw e; 156 | } 157 | } 158 | }, 159 | 160 | abort: function() { 161 | if ( callback ) { 162 | callback(); 163 | } 164 | } 165 | }; 166 | } 167 | } ); 168 | 169 | } ); 170 | -------------------------------------------------------------------------------- /bower_components/jquery/src/attributes/classes.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../var/rnotwhite", 4 | "../data/var/dataPriv", 5 | "../core/init" 6 | ], function( jQuery, rnotwhite, dataPriv ) { 7 | 8 | "use strict"; 9 | 10 | var rclass = /[\t\r\n\f]/g; 11 | 12 | function getClass( elem ) { 13 | return elem.getAttribute && elem.getAttribute( "class" ) || ""; 14 | } 15 | 16 | jQuery.fn.extend( { 17 | addClass: function( value ) { 18 | var classes, elem, cur, curValue, clazz, j, finalValue, 19 | i = 0; 20 | 21 | if ( jQuery.isFunction( value ) ) { 22 | return this.each( function( j ) { 23 | jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 24 | } ); 25 | } 26 | 27 | if ( typeof value === "string" && value ) { 28 | classes = value.match( rnotwhite ) || []; 29 | 30 | while ( ( elem = this[ i++ ] ) ) { 31 | curValue = getClass( elem ); 32 | cur = elem.nodeType === 1 && 33 | ( " " + curValue + " " ).replace( rclass, " " ); 34 | 35 | if ( cur ) { 36 | j = 0; 37 | while ( ( clazz = classes[ j++ ] ) ) { 38 | if ( cur.indexOf( " " + clazz + " " ) < 0 ) { 39 | cur += clazz + " "; 40 | } 41 | } 42 | 43 | // Only assign if different to avoid unneeded rendering. 44 | finalValue = jQuery.trim( cur ); 45 | if ( curValue !== finalValue ) { 46 | elem.setAttribute( "class", finalValue ); 47 | } 48 | } 49 | } 50 | } 51 | 52 | return this; 53 | }, 54 | 55 | removeClass: function( value ) { 56 | var classes, elem, cur, curValue, clazz, j, finalValue, 57 | i = 0; 58 | 59 | if ( jQuery.isFunction( value ) ) { 60 | return this.each( function( j ) { 61 | jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 62 | } ); 63 | } 64 | 65 | if ( !arguments.length ) { 66 | return this.attr( "class", "" ); 67 | } 68 | 69 | if ( typeof value === "string" && value ) { 70 | classes = value.match( rnotwhite ) || []; 71 | 72 | while ( ( elem = this[ i++ ] ) ) { 73 | curValue = getClass( elem ); 74 | 75 | // This expression is here for better compressibility (see addClass) 76 | cur = elem.nodeType === 1 && 77 | ( " " + curValue + " " ).replace( rclass, " " ); 78 | 79 | if ( cur ) { 80 | j = 0; 81 | while ( ( clazz = classes[ j++ ] ) ) { 82 | 83 | // Remove *all* instances 84 | while ( cur.indexOf( " " + clazz + " " ) > -1 ) { 85 | cur = cur.replace( " " + clazz + " ", " " ); 86 | } 87 | } 88 | 89 | // Only assign if different to avoid unneeded rendering. 90 | finalValue = jQuery.trim( cur ); 91 | if ( curValue !== finalValue ) { 92 | elem.setAttribute( "class", finalValue ); 93 | } 94 | } 95 | } 96 | } 97 | 98 | return this; 99 | }, 100 | 101 | toggleClass: function( value, stateVal ) { 102 | var type = typeof value; 103 | 104 | if ( typeof stateVal === "boolean" && type === "string" ) { 105 | return stateVal ? this.addClass( value ) : this.removeClass( value ); 106 | } 107 | 108 | if ( jQuery.isFunction( value ) ) { 109 | return this.each( function( i ) { 110 | jQuery( this ).toggleClass( 111 | value.call( this, i, getClass( this ), stateVal ), 112 | stateVal 113 | ); 114 | } ); 115 | } 116 | 117 | return this.each( function() { 118 | var className, i, self, classNames; 119 | 120 | if ( type === "string" ) { 121 | 122 | // Toggle individual class names 123 | i = 0; 124 | self = jQuery( this ); 125 | classNames = value.match( rnotwhite ) || []; 126 | 127 | while ( ( className = classNames[ i++ ] ) ) { 128 | 129 | // Check each className given, space separated list 130 | if ( self.hasClass( className ) ) { 131 | self.removeClass( className ); 132 | } else { 133 | self.addClass( className ); 134 | } 135 | } 136 | 137 | // Toggle whole class name 138 | } else if ( value === undefined || type === "boolean" ) { 139 | className = getClass( this ); 140 | if ( className ) { 141 | 142 | // Store className if set 143 | dataPriv.set( this, "__className__", className ); 144 | } 145 | 146 | // If the element has a class name or if we're passed `false`, 147 | // then remove the whole classname (if there was one, the above saved it). 148 | // Otherwise bring back whatever was previously saved (if anything), 149 | // falling back to the empty string if nothing was stored. 150 | if ( this.setAttribute ) { 151 | this.setAttribute( "class", 152 | className || value === false ? 153 | "" : 154 | dataPriv.get( this, "__className__" ) || "" 155 | ); 156 | } 157 | } 158 | } ); 159 | }, 160 | 161 | hasClass: function( selector ) { 162 | var className, elem, 163 | i = 0; 164 | 165 | className = " " + selector + " "; 166 | while ( ( elem = this[ i++ ] ) ) { 167 | if ( elem.nodeType === 1 && 168 | ( " " + getClass( elem ) + " " ).replace( rclass, " " ) 169 | .indexOf( className ) > -1 170 | ) { 171 | return true; 172 | } 173 | } 174 | 175 | return false; 176 | } 177 | } ); 178 | 179 | } ); 180 | -------------------------------------------------------------------------------- /bower_components/jquery/src/event/trigger.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "../core", 3 | "../var/document", 4 | "../data/var/dataPriv", 5 | "../data/var/acceptData", 6 | "../var/hasOwn", 7 | 8 | "../event" 9 | ], function( jQuery, document, dataPriv, acceptData, hasOwn ) { 10 | 11 | "use strict"; 12 | 13 | var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/; 14 | 15 | jQuery.extend( jQuery.event, { 16 | 17 | trigger: function( event, data, elem, onlyHandlers ) { 18 | 19 | var i, cur, tmp, bubbleType, ontype, handle, special, 20 | eventPath = [ elem || document ], 21 | type = hasOwn.call( event, "type" ) ? event.type : event, 22 | namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 23 | 24 | cur = tmp = elem = elem || document; 25 | 26 | // Don't do events on text and comment nodes 27 | if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 28 | return; 29 | } 30 | 31 | // focus/blur morphs to focusin/out; ensure we're not firing them right now 32 | if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 33 | return; 34 | } 35 | 36 | if ( type.indexOf( "." ) > -1 ) { 37 | 38 | // Namespaced trigger; create a regexp to match event type in handle() 39 | namespaces = type.split( "." ); 40 | type = namespaces.shift(); 41 | namespaces.sort(); 42 | } 43 | ontype = type.indexOf( ":" ) < 0 && "on" + type; 44 | 45 | // Caller can pass in a jQuery.Event object, Object, or just an event type string 46 | event = event[ jQuery.expando ] ? 47 | event : 48 | new jQuery.Event( type, typeof event === "object" && event ); 49 | 50 | // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 51 | event.isTrigger = onlyHandlers ? 2 : 3; 52 | event.namespace = namespaces.join( "." ); 53 | event.rnamespace = event.namespace ? 54 | new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 55 | null; 56 | 57 | // Clean up the event in case it is being reused 58 | event.result = undefined; 59 | if ( !event.target ) { 60 | event.target = elem; 61 | } 62 | 63 | // Clone any incoming data and prepend the event, creating the handler arg list 64 | data = data == null ? 65 | [ event ] : 66 | jQuery.makeArray( data, [ event ] ); 67 | 68 | // Allow special events to draw outside the lines 69 | special = jQuery.event.special[ type ] || {}; 70 | if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 71 | return; 72 | } 73 | 74 | // Determine event propagation path in advance, per W3C events spec (#9951) 75 | // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 76 | if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { 77 | 78 | bubbleType = special.delegateType || type; 79 | if ( !rfocusMorph.test( bubbleType + type ) ) { 80 | cur = cur.parentNode; 81 | } 82 | for ( ; cur; cur = cur.parentNode ) { 83 | eventPath.push( cur ); 84 | tmp = cur; 85 | } 86 | 87 | // Only add window if we got to document (e.g., not plain obj or detached DOM) 88 | if ( tmp === ( elem.ownerDocument || document ) ) { 89 | eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 90 | } 91 | } 92 | 93 | // Fire handlers on the event path 94 | i = 0; 95 | while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 96 | 97 | event.type = i > 1 ? 98 | bubbleType : 99 | special.bindType || type; 100 | 101 | // jQuery handler 102 | handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && 103 | dataPriv.get( cur, "handle" ); 104 | if ( handle ) { 105 | handle.apply( cur, data ); 106 | } 107 | 108 | // Native handler 109 | handle = ontype && cur[ ontype ]; 110 | if ( handle && handle.apply && acceptData( cur ) ) { 111 | event.result = handle.apply( cur, data ); 112 | if ( event.result === false ) { 113 | event.preventDefault(); 114 | } 115 | } 116 | } 117 | event.type = type; 118 | 119 | // If nobody prevented the default action, do it now 120 | if ( !onlyHandlers && !event.isDefaultPrevented() ) { 121 | 122 | if ( ( !special._default || 123 | special._default.apply( eventPath.pop(), data ) === false ) && 124 | acceptData( elem ) ) { 125 | 126 | // Call a native DOM method on the target with the same name as the event. 127 | // Don't do default actions on window, that's where global variables be (#6170) 128 | if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { 129 | 130 | // Don't re-trigger an onFOO event when we call its FOO() method 131 | tmp = elem[ ontype ]; 132 | 133 | if ( tmp ) { 134 | elem[ ontype ] = null; 135 | } 136 | 137 | // Prevent re-triggering of the same event, since we already bubbled it above 138 | jQuery.event.triggered = type; 139 | elem[ type ](); 140 | jQuery.event.triggered = undefined; 141 | 142 | if ( tmp ) { 143 | elem[ ontype ] = tmp; 144 | } 145 | } 146 | } 147 | } 148 | 149 | return event.result; 150 | }, 151 | 152 | // Piggyback on a donor event to simulate a different one 153 | // Used only for `focus(in | out)` events 154 | simulate: function( type, elem, event ) { 155 | var e = jQuery.extend( 156 | new jQuery.Event(), 157 | event, 158 | { 159 | type: type, 160 | isSimulated: true 161 | } 162 | ); 163 | 164 | jQuery.event.trigger( e, null, elem ); 165 | } 166 | 167 | } ); 168 | 169 | jQuery.fn.extend( { 170 | 171 | trigger: function( type, data ) { 172 | return this.each( function() { 173 | jQuery.event.trigger( type, data, this ); 174 | } ); 175 | }, 176 | triggerHandler: function( type, data ) { 177 | var elem = this[ 0 ]; 178 | if ( elem ) { 179 | return jQuery.event.trigger( type, data, elem, true ); 180 | } 181 | } 182 | } ); 183 | 184 | return jQuery; 185 | } ); 186 | -------------------------------------------------------------------------------- /bower_components/jquery/src/callbacks.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./core", 3 | "./var/rnotwhite" 4 | ], function( jQuery, rnotwhite ) { 5 | 6 | "use strict"; 7 | 8 | // Convert String-formatted options into Object-formatted ones 9 | function createOptions( options ) { 10 | var object = {}; 11 | jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { 12 | object[ flag ] = true; 13 | } ); 14 | return object; 15 | } 16 | 17 | /* 18 | * Create a callback list using the following parameters: 19 | * 20 | * options: an optional list of space-separated options that will change how 21 | * the callback list behaves or a more traditional option object 22 | * 23 | * By default a callback list will act like an event callback list and can be 24 | * "fired" multiple times. 25 | * 26 | * Possible options: 27 | * 28 | * once: will ensure the callback list can only be fired once (like a Deferred) 29 | * 30 | * memory: will keep track of previous values and will call any callback added 31 | * after the list has been fired right away with the latest "memorized" 32 | * values (like a Deferred) 33 | * 34 | * unique: will ensure a callback can only be added once (no duplicate in the list) 35 | * 36 | * stopOnFalse: interrupt callings when a callback returns false 37 | * 38 | */ 39 | jQuery.Callbacks = function( options ) { 40 | 41 | // Convert options from String-formatted to Object-formatted if needed 42 | // (we check in cache first) 43 | options = typeof options === "string" ? 44 | createOptions( options ) : 45 | jQuery.extend( {}, options ); 46 | 47 | var // Flag to know if list is currently firing 48 | firing, 49 | 50 | // Last fire value for non-forgettable lists 51 | memory, 52 | 53 | // Flag to know if list was already fired 54 | fired, 55 | 56 | // Flag to prevent firing 57 | locked, 58 | 59 | // Actual callback list 60 | list = [], 61 | 62 | // Queue of execution data for repeatable lists 63 | queue = [], 64 | 65 | // Index of currently firing callback (modified by add/remove as needed) 66 | firingIndex = -1, 67 | 68 | // Fire callbacks 69 | fire = function() { 70 | 71 | // Enforce single-firing 72 | locked = options.once; 73 | 74 | // Execute callbacks for all pending executions, 75 | // respecting firingIndex overrides and runtime changes 76 | fired = firing = true; 77 | for ( ; queue.length; firingIndex = -1 ) { 78 | memory = queue.shift(); 79 | while ( ++firingIndex < list.length ) { 80 | 81 | // Run callback and check for early termination 82 | if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 83 | options.stopOnFalse ) { 84 | 85 | // Jump to end and forget the data so .add doesn't re-fire 86 | firingIndex = list.length; 87 | memory = false; 88 | } 89 | } 90 | } 91 | 92 | // Forget the data if we're done with it 93 | if ( !options.memory ) { 94 | memory = false; 95 | } 96 | 97 | firing = false; 98 | 99 | // Clean up if we're done firing for good 100 | if ( locked ) { 101 | 102 | // Keep an empty list if we have data for future add calls 103 | if ( memory ) { 104 | list = []; 105 | 106 | // Otherwise, this object is spent 107 | } else { 108 | list = ""; 109 | } 110 | } 111 | }, 112 | 113 | // Actual Callbacks object 114 | self = { 115 | 116 | // Add a callback or a collection of callbacks to the list 117 | add: function() { 118 | if ( list ) { 119 | 120 | // If we have memory from a past run, we should fire after adding 121 | if ( memory && !firing ) { 122 | firingIndex = list.length - 1; 123 | queue.push( memory ); 124 | } 125 | 126 | ( function add( args ) { 127 | jQuery.each( args, function( _, arg ) { 128 | if ( jQuery.isFunction( arg ) ) { 129 | if ( !options.unique || !self.has( arg ) ) { 130 | list.push( arg ); 131 | } 132 | } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { 133 | 134 | // Inspect recursively 135 | add( arg ); 136 | } 137 | } ); 138 | } )( arguments ); 139 | 140 | if ( memory && !firing ) { 141 | fire(); 142 | } 143 | } 144 | return this; 145 | }, 146 | 147 | // Remove a callback from the list 148 | remove: function() { 149 | jQuery.each( arguments, function( _, arg ) { 150 | var index; 151 | while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 152 | list.splice( index, 1 ); 153 | 154 | // Handle firing indexes 155 | if ( index <= firingIndex ) { 156 | firingIndex--; 157 | } 158 | } 159 | } ); 160 | return this; 161 | }, 162 | 163 | // Check if a given callback is in the list. 164 | // If no argument is given, return whether or not list has callbacks attached. 165 | has: function( fn ) { 166 | return fn ? 167 | jQuery.inArray( fn, list ) > -1 : 168 | list.length > 0; 169 | }, 170 | 171 | // Remove all callbacks from the list 172 | empty: function() { 173 | if ( list ) { 174 | list = []; 175 | } 176 | return this; 177 | }, 178 | 179 | // Disable .fire and .add 180 | // Abort any current/pending executions 181 | // Clear all callbacks and values 182 | disable: function() { 183 | locked = queue = []; 184 | list = memory = ""; 185 | return this; 186 | }, 187 | disabled: function() { 188 | return !list; 189 | }, 190 | 191 | // Disable .fire 192 | // Also disable .add unless we have memory (since it would have no effect) 193 | // Abort any pending executions 194 | lock: function() { 195 | locked = queue = []; 196 | if ( !memory && !firing ) { 197 | list = memory = ""; 198 | } 199 | return this; 200 | }, 201 | locked: function() { 202 | return !!locked; 203 | }, 204 | 205 | // Call all callbacks with the given context and arguments 206 | fireWith: function( context, args ) { 207 | if ( !locked ) { 208 | args = args || []; 209 | args = [ context, args.slice ? args.slice() : args ]; 210 | queue.push( args ); 211 | if ( !firing ) { 212 | fire(); 213 | } 214 | } 215 | return this; 216 | }, 217 | 218 | // Call all the callbacks with the given arguments 219 | fire: function() { 220 | self.fireWith( this, arguments ); 221 | return this; 222 | }, 223 | 224 | // To know if the callbacks have already been called at least once 225 | fired: function() { 226 | return !!fired; 227 | } 228 | }; 229 | 230 | return self; 231 | }; 232 | 233 | return jQuery; 234 | } ); 235 | -------------------------------------------------------------------------------- /bower_components/jquery/src/offset.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./core", 3 | "./core/access", 4 | "./var/document", 5 | "./var/documentElement", 6 | "./css/var/rnumnonpx", 7 | "./css/curCSS", 8 | "./css/addGetHookIf", 9 | "./css/support", 10 | 11 | "./core/init", 12 | "./css", 13 | "./selector" // contains 14 | ], function( jQuery, access, document, documentElement, rnumnonpx, curCSS, addGetHookIf, support ) { 15 | 16 | "use strict"; 17 | 18 | /** 19 | * Gets a window from an element 20 | */ 21 | function getWindow( elem ) { 22 | return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView; 23 | } 24 | 25 | jQuery.offset = { 26 | setOffset: function( elem, options, i ) { 27 | var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 28 | position = jQuery.css( elem, "position" ), 29 | curElem = jQuery( elem ), 30 | props = {}; 31 | 32 | // Set position first, in-case top/left are set even on static elem 33 | if ( position === "static" ) { 34 | elem.style.position = "relative"; 35 | } 36 | 37 | curOffset = curElem.offset(); 38 | curCSSTop = jQuery.css( elem, "top" ); 39 | curCSSLeft = jQuery.css( elem, "left" ); 40 | calculatePosition = ( position === "absolute" || position === "fixed" ) && 41 | ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; 42 | 43 | // Need to be able to calculate position if either 44 | // top or left is auto and position is either absolute or fixed 45 | if ( calculatePosition ) { 46 | curPosition = curElem.position(); 47 | curTop = curPosition.top; 48 | curLeft = curPosition.left; 49 | 50 | } else { 51 | curTop = parseFloat( curCSSTop ) || 0; 52 | curLeft = parseFloat( curCSSLeft ) || 0; 53 | } 54 | 55 | if ( jQuery.isFunction( options ) ) { 56 | 57 | // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 58 | options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 59 | } 60 | 61 | if ( options.top != null ) { 62 | props.top = ( options.top - curOffset.top ) + curTop; 63 | } 64 | if ( options.left != null ) { 65 | props.left = ( options.left - curOffset.left ) + curLeft; 66 | } 67 | 68 | if ( "using" in options ) { 69 | options.using.call( elem, props ); 70 | 71 | } else { 72 | curElem.css( props ); 73 | } 74 | } 75 | }; 76 | 77 | jQuery.fn.extend( { 78 | offset: function( options ) { 79 | 80 | // Preserve chaining for setter 81 | if ( arguments.length ) { 82 | return options === undefined ? 83 | this : 84 | this.each( function( i ) { 85 | jQuery.offset.setOffset( this, options, i ); 86 | } ); 87 | } 88 | 89 | var docElem, win, rect, doc, 90 | elem = this[ 0 ]; 91 | 92 | if ( !elem ) { 93 | return; 94 | } 95 | 96 | // Support: IE <=11 only 97 | // Running getBoundingClientRect on a 98 | // disconnected node in IE throws an error 99 | if ( !elem.getClientRects().length ) { 100 | return { top: 0, left: 0 }; 101 | } 102 | 103 | rect = elem.getBoundingClientRect(); 104 | 105 | // Make sure element is not hidden (display: none) 106 | if ( rect.width || rect.height ) { 107 | doc = elem.ownerDocument; 108 | win = getWindow( doc ); 109 | docElem = doc.documentElement; 110 | 111 | return { 112 | top: rect.top + win.pageYOffset - docElem.clientTop, 113 | left: rect.left + win.pageXOffset - docElem.clientLeft 114 | }; 115 | } 116 | 117 | // Return zeros for disconnected and hidden elements (gh-2310) 118 | return rect; 119 | }, 120 | 121 | position: function() { 122 | if ( !this[ 0 ] ) { 123 | return; 124 | } 125 | 126 | var offsetParent, offset, 127 | elem = this[ 0 ], 128 | parentOffset = { top: 0, left: 0 }; 129 | 130 | // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, 131 | // because it is its only offset parent 132 | if ( jQuery.css( elem, "position" ) === "fixed" ) { 133 | 134 | // Assume getBoundingClientRect is there when computed position is fixed 135 | offset = elem.getBoundingClientRect(); 136 | 137 | } else { 138 | 139 | // Get *real* offsetParent 140 | offsetParent = this.offsetParent(); 141 | 142 | // Get correct offsets 143 | offset = this.offset(); 144 | if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { 145 | parentOffset = offsetParent.offset(); 146 | } 147 | 148 | // Add offsetParent borders 149 | parentOffset = { 150 | top: parentOffset.top + jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ), 151 | left: parentOffset.left + jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ) 152 | }; 153 | } 154 | 155 | // Subtract parent offsets and element margins 156 | return { 157 | top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 158 | left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 159 | }; 160 | }, 161 | 162 | // This method will return documentElement in the following cases: 163 | // 1) For the element inside the iframe without offsetParent, this method will return 164 | // documentElement of the parent window 165 | // 2) For the hidden or detached element 166 | // 3) For body or html element, i.e. in case of the html node - it will return itself 167 | // 168 | // but those exceptions were never presented as a real life use-cases 169 | // and might be considered as more preferable results. 170 | // 171 | // This logic, however, is not guaranteed and can change at any point in the future 172 | offsetParent: function() { 173 | return this.map( function() { 174 | var offsetParent = this.offsetParent; 175 | 176 | while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { 177 | offsetParent = offsetParent.offsetParent; 178 | } 179 | 180 | return offsetParent || documentElement; 181 | } ); 182 | } 183 | } ); 184 | 185 | // Create scrollLeft and scrollTop methods 186 | jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 187 | var top = "pageYOffset" === prop; 188 | 189 | jQuery.fn[ method ] = function( val ) { 190 | return access( this, function( elem, method, val ) { 191 | var win = getWindow( elem ); 192 | 193 | if ( val === undefined ) { 194 | return win ? win[ prop ] : elem[ method ]; 195 | } 196 | 197 | if ( win ) { 198 | win.scrollTo( 199 | !top ? val : win.pageXOffset, 200 | top ? val : win.pageYOffset 201 | ); 202 | 203 | } else { 204 | elem[ method ] = val; 205 | } 206 | }, method, val, arguments.length ); 207 | }; 208 | } ); 209 | 210 | // Support: Safari <=7 - 9.1, Chrome <=37 - 49 211 | // Add the top/left cssHooks using jQuery.fn.position 212 | // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 213 | // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 214 | // getComputedStyle returns percent when specified for top/left/bottom/right; 215 | // rather than make the css module depend on the offset module, just check for it here 216 | jQuery.each( [ "top", "left" ], function( i, prop ) { 217 | jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 218 | function( elem, computed ) { 219 | if ( computed ) { 220 | computed = curCSS( elem, prop ); 221 | 222 | // If curCSS returns percentage, fallback to offset 223 | return rnumnonpx.test( computed ) ? 224 | jQuery( elem ).position()[ prop ] + "px" : 225 | computed; 226 | } 227 | } 228 | ); 229 | } ); 230 | 231 | return jQuery; 232 | } ); 233 | -------------------------------------------------------------------------------- /bower_components/jquery/src/selector-native.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./core", 3 | "./var/document", 4 | "./var/documentElement", 5 | "./var/hasOwn", 6 | "./var/indexOf" 7 | ], function( jQuery, document, documentElement, hasOwn, indexOf ) { 8 | 9 | "use strict"; 10 | 11 | /* 12 | * Optional (non-Sizzle) selector module for custom builds. 13 | * 14 | * Note that this DOES NOT SUPPORT many documented jQuery 15 | * features in exchange for its smaller size: 16 | * 17 | * Attribute not equal selector 18 | * Positional selectors (:first; :eq(n); :odd; etc.) 19 | * Type selectors (:input; :checkbox; :button; etc.) 20 | * State-based selectors (:animated; :visible; :hidden; etc.) 21 | * :has(selector) 22 | * :not(complex selector) 23 | * custom selectors via Sizzle extensions 24 | * Leading combinators (e.g., $collection.find("> *")) 25 | * Reliable functionality on XML fragments 26 | * Requiring all parts of a selector to match elements under context 27 | * (e.g., $div.find("div > *") now matches children of $div) 28 | * Matching against non-elements 29 | * Reliable sorting of disconnected nodes 30 | * querySelectorAll bug fixes (e.g., unreliable :focus on WebKit) 31 | * 32 | * If any of these are unacceptable tradeoffs, either use Sizzle or 33 | * customize this stub for the project's specific needs. 34 | */ 35 | 36 | var hasDuplicate, sortInput, 37 | sortStable = jQuery.expando.split( "" ).sort( sortOrder ).join( "" ) === jQuery.expando, 38 | matches = documentElement.matches || 39 | documentElement.webkitMatchesSelector || 40 | documentElement.mozMatchesSelector || 41 | documentElement.oMatchesSelector || 42 | documentElement.msMatchesSelector, 43 | 44 | // CSS string/identifier serialization 45 | // https://drafts.csswg.org/cssom/#common-serializing-idioms 46 | rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g, 47 | fcssescape = function( ch, asCodePoint ) { 48 | if ( asCodePoint ) { 49 | 50 | // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 51 | if ( ch === "\0" ) { 52 | return "\uFFFD"; 53 | } 54 | 55 | // Control characters and (dependent upon position) numbers get escaped as code points 56 | return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; 57 | } 58 | 59 | // Other potentially-special ASCII characters get backslash-escaped 60 | return "\\" + ch; 61 | }; 62 | 63 | function sortOrder( a, b ) { 64 | 65 | // Flag for duplicate removal 66 | if ( a === b ) { 67 | hasDuplicate = true; 68 | return 0; 69 | } 70 | 71 | // Sort on method existence if only one input has compareDocumentPosition 72 | var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 73 | if ( compare ) { 74 | return compare; 75 | } 76 | 77 | // Calculate position if both inputs belong to the same document 78 | compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? 79 | a.compareDocumentPosition( b ) : 80 | 81 | // Otherwise we know they are disconnected 82 | 1; 83 | 84 | // Disconnected nodes 85 | if ( compare & 1 ) { 86 | 87 | // Choose the first element that is related to our preferred document 88 | if ( a === document || a.ownerDocument === document && 89 | jQuery.contains( document, a ) ) { 90 | return -1; 91 | } 92 | if ( b === document || b.ownerDocument === document && 93 | jQuery.contains( document, b ) ) { 94 | return 1; 95 | } 96 | 97 | // Maintain original order 98 | return sortInput ? 99 | ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 100 | 0; 101 | } 102 | 103 | return compare & 4 ? -1 : 1; 104 | } 105 | 106 | function uniqueSort( results ) { 107 | var elem, 108 | duplicates = [], 109 | j = 0, 110 | i = 0; 111 | 112 | hasDuplicate = false; 113 | sortInput = !sortStable && results.slice( 0 ); 114 | results.sort( sortOrder ); 115 | 116 | if ( hasDuplicate ) { 117 | while ( ( elem = results[ i++ ] ) ) { 118 | if ( elem === results[ i ] ) { 119 | j = duplicates.push( i ); 120 | } 121 | } 122 | while ( j-- ) { 123 | results.splice( duplicates[ j ], 1 ); 124 | } 125 | } 126 | 127 | // Clear input after sorting to release objects 128 | // See https://github.com/jquery/sizzle/pull/225 129 | sortInput = null; 130 | 131 | return results; 132 | } 133 | 134 | function escape( sel ) { 135 | return ( sel + "" ).replace( rcssescape, fcssescape ); 136 | } 137 | 138 | jQuery.extend( { 139 | uniqueSort: uniqueSort, 140 | unique: uniqueSort, 141 | escapeSelector: escape, 142 | find: function( selector, context, results, seed ) { 143 | var elem, nodeType, 144 | i = 0; 145 | 146 | results = results || []; 147 | context = context || document; 148 | 149 | // Same basic safeguard as Sizzle 150 | if ( !selector || typeof selector !== "string" ) { 151 | return results; 152 | } 153 | 154 | // Early return if context is not an element or document 155 | if ( ( nodeType = context.nodeType ) !== 1 && nodeType !== 9 ) { 156 | return []; 157 | } 158 | 159 | if ( seed ) { 160 | while ( ( elem = seed[ i++ ] ) ) { 161 | if ( jQuery.find.matchesSelector( elem, selector ) ) { 162 | results.push( elem ); 163 | } 164 | } 165 | } else { 166 | jQuery.merge( results, context.querySelectorAll( selector ) ); 167 | } 168 | 169 | return results; 170 | }, 171 | text: function( elem ) { 172 | var node, 173 | ret = "", 174 | i = 0, 175 | nodeType = elem.nodeType; 176 | 177 | if ( !nodeType ) { 178 | 179 | // If no nodeType, this is expected to be an array 180 | while ( ( node = elem[ i++ ] ) ) { 181 | 182 | // Do not traverse comment nodes 183 | ret += jQuery.text( node ); 184 | } 185 | } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 186 | 187 | // Use textContent for elements 188 | return elem.textContent; 189 | } else if ( nodeType === 3 || nodeType === 4 ) { 190 | return elem.nodeValue; 191 | } 192 | 193 | // Do not include comment or processing instruction nodes 194 | 195 | return ret; 196 | }, 197 | contains: function( a, b ) { 198 | var adown = a.nodeType === 9 ? a.documentElement : a, 199 | bup = b && b.parentNode; 200 | return a === bup || !!( bup && bup.nodeType === 1 && adown.contains( bup ) ); 201 | }, 202 | isXMLDoc: function( elem ) { 203 | 204 | // documentElement is verified for cases where it doesn't yet exist 205 | // (such as loading iframes in IE - #4833) 206 | var documentElement = elem && ( elem.ownerDocument || elem ).documentElement; 207 | return documentElement ? documentElement.nodeName !== "HTML" : false; 208 | }, 209 | expr: { 210 | attrHandle: {}, 211 | match: { 212 | bool: new RegExp( "^(?:checked|selected|async|autofocus|autoplay|controls|defer" + 213 | "|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$", "i" ), 214 | needsContext: /^[\x20\t\r\n\f]*[>+~]/ 215 | } 216 | } 217 | } ); 218 | 219 | jQuery.extend( jQuery.find, { 220 | matches: function( expr, elements ) { 221 | return jQuery.find( expr, null, null, elements ); 222 | }, 223 | matchesSelector: function( elem, expr ) { 224 | return matches.call( elem, expr ); 225 | }, 226 | attr: function( elem, name ) { 227 | var fn = jQuery.expr.attrHandle[ name.toLowerCase() ], 228 | 229 | // Don't get fooled by Object.prototype properties (jQuery #13807) 230 | value = fn && hasOwn.call( jQuery.expr.attrHandle, name.toLowerCase() ) ? 231 | fn( elem, name, jQuery.isXMLDoc( elem ) ) : 232 | undefined; 233 | return value !== undefined ? value : elem.getAttribute( name ); 234 | } 235 | } ); 236 | 237 | } ); 238 | -------------------------------------------------------------------------------- /bower_components/jquery/AUTHORS.txt: -------------------------------------------------------------------------------- 1 | Authors ordered by first contribution. 2 | 3 | John Resig 4 | Gilles van den Hoven 5 | Michael Geary 6 | Stefan Petre 7 | Yehuda Katz 8 | Corey Jewett 9 | Klaus Hartl 10 | Franck Marcia 11 | Jörn Zaefferer 12 | Paul Bakaus 13 | Brandon Aaron 14 | Mike Alsup 15 | Dave Methvin 16 | Ed Engelhardt 17 | Sean Catchpole 18 | Paul Mclanahan 19 | David Serduke 20 | Richard D. Worth 21 | Scott González 22 | Ariel Flesler 23 | Jon Evans 24 | TJ Holowaychuk 25 | Michael Bensoussan 26 | Robert Katić 27 | Louis-Rémi Babé 28 | Earle Castledine 29 | Damian Janowski 30 | Rich Dougherty 31 | Kim Dalsgaard 32 | Andrea Giammarchi 33 | Mark Gibson 34 | Karl Swedberg 35 | Justin Meyer 36 | Ben Alman 37 | James Padolsey 38 | David Petersen 39 | Batiste Bieler 40 | Alexander Farkas 41 | Rick Waldron 42 | Filipe Fortes 43 | Neeraj Singh 44 | Paul Irish 45 | Iraê Carvalho 46 | Matt Curry 47 | Michael Monteleone 48 | Noah Sloan 49 | Tom Viner 50 | Douglas Neiner 51 | Adam J. Sontag 52 | Dave Reed 53 | Ralph Whitbeck 54 | Carl Fürstenberg 55 | Jacob Wright 56 | J. Ryan Stinnett 57 | unknown 58 | temp01 59 | Heungsub Lee 60 | Colin Snover 61 | Ryan W Tenney 62 | Pinhook 63 | Ron Otten 64 | Jephte Clain 65 | Anton Matzneller 66 | Alex Sexton 67 | Dan Heberden 68 | Henri Wiechers 69 | Russell Holbrook 70 | Julian Aubourg 71 | Gianni Alessandro Chiappetta 72 | Scott Jehl 73 | James Burke 74 | Jonas Pfenniger 75 | Xavi Ramirez 76 | Jared Grippe 77 | Sylvester Keil 78 | Brandon Sterne 79 | Mathias Bynens 80 | Timmy Willison 81 | Corey Frang 82 | Digitalxero 83 | Anton Kovalyov 84 | David Murdoch 85 | Josh Varner 86 | Charles McNulty 87 | Jordan Boesch 88 | Jess Thrysoee 89 | Michael Murray 90 | Lee Carpenter 91 | Alexis Abril 92 | Rob Morgan 93 | John Firebaugh 94 | Sam Bisbee 95 | Gilmore Davidson 96 | Brian Brennan 97 | Xavier Montillet 98 | Daniel Pihlstrom 99 | Sahab Yazdani 100 | avaly 101 | Scott Hughes 102 | Mike Sherov 103 | Greg Hazel 104 | Schalk Neethling 105 | Denis Knauf 106 | Timo Tijhof 107 | Steen Nielsen 108 | Anton Ryzhov 109 | Shi Chuan 110 | Berker Peksag 111 | Toby Brain 112 | Matt Mueller 113 | Justin 114 | Daniel Herman 115 | Oleg Gaidarenko 116 | Richard Gibson 117 | Rafaël Blais Masson 118 | cmc3cn <59194618@qq.com> 119 | Joe Presbrey 120 | Sindre Sorhus 121 | Arne de Bree 122 | Vladislav Zarakovsky 123 | Andrew E Monat 124 | Oskari 125 | Joao Henrique de Andrade Bruni 126 | tsinha 127 | Matt Farmer 128 | Trey Hunner 129 | Jason Moon 130 | Jeffery To 131 | Kris Borchers 132 | Vladimir Zhuravlev 133 | Jacob Thornton 134 | Chad Killingsworth 135 | Nowres Rafid 136 | David Benjamin 137 | Uri Gilad 138 | Chris Faulkner 139 | Elijah Manor 140 | Daniel Chatfield 141 | Nikita Govorov 142 | Wesley Walser 143 | Mike Pennisi 144 | Markus Staab 145 | Dave Riddle 146 | Callum Macrae 147 | Benjamin Truyman 148 | James Huston 149 | Erick Ruiz de Chávez 150 | David Bonner 151 | Akintayo Akinwunmi 152 | MORGAN 153 | Ismail Khair 154 | Carl Danley 155 | Mike Petrovich 156 | Greg Lavallee 157 | Daniel Gálvez 158 | Sai Lung Wong 159 | Tom H Fuertes 160 | Roland Eckl 161 | Jay Merrifield 162 | Allen J Schmidt Jr 163 | Jonathan Sampson 164 | Marcel Greter 165 | Matthias Jäggli 166 | David Fox 167 | Yiming He 168 | Devin Cooper 169 | Paul Ramos 170 | Rod Vagg 171 | Bennett Sorbo 172 | Sebastian Burkhard 173 | Zachary Adam Kaplan 174 | nanto_vi 175 | nanto 176 | Danil Somsikov 177 | Ryunosuke SATO 178 | Jean Boussier 179 | Adam Coulombe 180 | Andrew Plummer 181 | Mark Raddatz 182 | Isaac Z. Schlueter 183 | Karl Sieburg 184 | Pascal Borreli 185 | Nguyen Phuc Lam 186 | Dmitry Gusev 187 | Michał Gołębiowski 188 | Li Xudong 189 | Steven Benner 190 | Tom H Fuertes 191 | Renato Oliveira dos Santos 192 | ros3cin 193 | Jason Bedard 194 | Kyle Robinson Young 195 | Chris Talkington 196 | Eddie Monge 197 | Terry Jones 198 | Jason Merino 199 | Jeremy Dunck 200 | Chris Price 201 | Guy Bedford 202 | Amey Sakhadeo 203 | Mike Sidorov 204 | Anthony Ryan 205 | Dominik D. Geyer 206 | George Kats 207 | Lihan Li 208 | Ronny Springer 209 | Chris Antaki 210 | Marian Sollmann 211 | njhamann 212 | Ilya Kantor 213 | David Hong 214 | John Paul 215 | Jakob Stoeck 216 | Christopher Jones 217 | Forbes Lindesay 218 | S. Andrew Sheppard 219 | Leonardo Balter 220 | Roman Reiß 221 | Benjy Cui 222 | Rodrigo Rosenfeld Rosas 223 | John Hoven 224 | Philip Jägenstedt 225 | Christian Kosmowski 226 | Liang Peng 227 | TJ VanToll 228 | Senya Pugach 229 | Aurelio De Rosa 230 | Nazar Mokrynskyi 231 | Amit Merchant 232 | Jason Bedard 233 | Arthur Verschaeve 234 | Dan Hart 235 | Bin Xin 236 | David Corbacho 237 | Veaceslav Grimalschi 238 | Daniel Husar 239 | Frederic Hemberger 240 | Ben Toews 241 | Aditya Raghavan 242 | Victor Homyakov 243 | Shivaji Varma 244 | Nicolas HENRY 245 | Anne-Gaelle Colom 246 | George Mauer 247 | Leonardo Braga 248 | Stephen Edgar 249 | Thomas Tortorini 250 | Winston Howes 251 | Jon Hester 252 | Alexander O'Mara 253 | Bastian Buchholz 254 | Arthur Stolyar 255 | Calvin Metcalf 256 | Mu Haibao 257 | Richard McDaniel 258 | Chris Rebert 259 | Gabriel Schulhof 260 | Gilad Peleg 261 | Martin Naumann 262 | Marek Lewandowski 263 | Bruno Pérel 264 | Reed Loden 265 | Daniel Nill 266 | Yongwoo Jeon 267 | Sean Henderson 268 | Richard Kraaijenhagen 269 | Connor Atherton 270 | Gary Ye 271 | Christian Grete 272 | Liza Ramo 273 | Julian Alexander Murillo 274 | Joelle Fleurantin 275 | Jae Sung Park 276 | Jun Sun 277 | Josh Soref 278 | Henry Wong 279 | Jon Dufresne 280 | Martijn W. van der Lee 281 | Devin Wilson 282 | Steve Mao 283 | Zack Hall 284 | Bernhard M. Wiedemann 285 | Todor Prikumov 286 | Jha Naman 287 | William Robinet 288 | Alexander Lisianoi 289 | Vitaliy Terziev 290 | Joe Trumbull 291 | Alexander K 292 | Damian Senn 293 | Ralin Chimev 294 | Felipe Sateler 295 | Christophe Tafani-Dereeper 296 | -------------------------------------------------------------------------------- /bower_components/jquery/src/deferred.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./core", 3 | "./var/slice", 4 | "./callbacks" 5 | ], function( jQuery, slice ) { 6 | 7 | "use strict"; 8 | 9 | function Identity( v ) { 10 | return v; 11 | } 12 | function Thrower( ex ) { 13 | throw ex; 14 | } 15 | 16 | function adoptValue( value, resolve, reject ) { 17 | var method; 18 | 19 | try { 20 | 21 | // Check for promise aspect first to privilege synchronous behavior 22 | if ( value && jQuery.isFunction( ( method = value.promise ) ) ) { 23 | method.call( value ).done( resolve ).fail( reject ); 24 | 25 | // Other thenables 26 | } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) { 27 | method.call( value, resolve, reject ); 28 | 29 | // Other non-thenables 30 | } else { 31 | 32 | // Support: Android 4.0 only 33 | // Strict mode functions invoked without .call/.apply get global-object context 34 | resolve.call( undefined, value ); 35 | } 36 | 37 | // For Promises/A+, convert exceptions into rejections 38 | // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in 39 | // Deferred#then to conditionally suppress rejection. 40 | } catch ( value ) { 41 | 42 | // Support: Android 4.0 only 43 | // Strict mode functions invoked without .call/.apply get global-object context 44 | reject.call( undefined, value ); 45 | } 46 | } 47 | 48 | jQuery.extend( { 49 | 50 | Deferred: function( func ) { 51 | var tuples = [ 52 | 53 | // action, add listener, callbacks, 54 | // ... .then handlers, argument index, [final state] 55 | [ "notify", "progress", jQuery.Callbacks( "memory" ), 56 | jQuery.Callbacks( "memory" ), 2 ], 57 | [ "resolve", "done", jQuery.Callbacks( "once memory" ), 58 | jQuery.Callbacks( "once memory" ), 0, "resolved" ], 59 | [ "reject", "fail", jQuery.Callbacks( "once memory" ), 60 | jQuery.Callbacks( "once memory" ), 1, "rejected" ] 61 | ], 62 | state = "pending", 63 | promise = { 64 | state: function() { 65 | return state; 66 | }, 67 | always: function() { 68 | deferred.done( arguments ).fail( arguments ); 69 | return this; 70 | }, 71 | "catch": function( fn ) { 72 | return promise.then( null, fn ); 73 | }, 74 | 75 | // Keep pipe for back-compat 76 | pipe: function( /* fnDone, fnFail, fnProgress */ ) { 77 | var fns = arguments; 78 | 79 | return jQuery.Deferred( function( newDefer ) { 80 | jQuery.each( tuples, function( i, tuple ) { 81 | 82 | // Map tuples (progress, done, fail) to arguments (done, fail, progress) 83 | var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; 84 | 85 | // deferred.progress(function() { bind to newDefer or newDefer.notify }) 86 | // deferred.done(function() { bind to newDefer or newDefer.resolve }) 87 | // deferred.fail(function() { bind to newDefer or newDefer.reject }) 88 | deferred[ tuple[ 1 ] ]( function() { 89 | var returned = fn && fn.apply( this, arguments ); 90 | if ( returned && jQuery.isFunction( returned.promise ) ) { 91 | returned.promise() 92 | .progress( newDefer.notify ) 93 | .done( newDefer.resolve ) 94 | .fail( newDefer.reject ); 95 | } else { 96 | newDefer[ tuple[ 0 ] + "With" ]( 97 | this, 98 | fn ? [ returned ] : arguments 99 | ); 100 | } 101 | } ); 102 | } ); 103 | fns = null; 104 | } ).promise(); 105 | }, 106 | then: function( onFulfilled, onRejected, onProgress ) { 107 | var maxDepth = 0; 108 | function resolve( depth, deferred, handler, special ) { 109 | return function() { 110 | var that = this, 111 | args = arguments, 112 | mightThrow = function() { 113 | var returned, then; 114 | 115 | // Support: Promises/A+ section 2.3.3.3.3 116 | // https://promisesaplus.com/#point-59 117 | // Ignore double-resolution attempts 118 | if ( depth < maxDepth ) { 119 | return; 120 | } 121 | 122 | returned = handler.apply( that, args ); 123 | 124 | // Support: Promises/A+ section 2.3.1 125 | // https://promisesaplus.com/#point-48 126 | if ( returned === deferred.promise() ) { 127 | throw new TypeError( "Thenable self-resolution" ); 128 | } 129 | 130 | // Support: Promises/A+ sections 2.3.3.1, 3.5 131 | // https://promisesaplus.com/#point-54 132 | // https://promisesaplus.com/#point-75 133 | // Retrieve `then` only once 134 | then = returned && 135 | 136 | // Support: Promises/A+ section 2.3.4 137 | // https://promisesaplus.com/#point-64 138 | // Only check objects and functions for thenability 139 | ( typeof returned === "object" || 140 | typeof returned === "function" ) && 141 | returned.then; 142 | 143 | // Handle a returned thenable 144 | if ( jQuery.isFunction( then ) ) { 145 | 146 | // Special processors (notify) just wait for resolution 147 | if ( special ) { 148 | then.call( 149 | returned, 150 | resolve( maxDepth, deferred, Identity, special ), 151 | resolve( maxDepth, deferred, Thrower, special ) 152 | ); 153 | 154 | // Normal processors (resolve) also hook into progress 155 | } else { 156 | 157 | // ...and disregard older resolution values 158 | maxDepth++; 159 | 160 | then.call( 161 | returned, 162 | resolve( maxDepth, deferred, Identity, special ), 163 | resolve( maxDepth, deferred, Thrower, special ), 164 | resolve( maxDepth, deferred, Identity, 165 | deferred.notifyWith ) 166 | ); 167 | } 168 | 169 | // Handle all other returned values 170 | } else { 171 | 172 | // Only substitute handlers pass on context 173 | // and multiple values (non-spec behavior) 174 | if ( handler !== Identity ) { 175 | that = undefined; 176 | args = [ returned ]; 177 | } 178 | 179 | // Process the value(s) 180 | // Default process is resolve 181 | ( special || deferred.resolveWith )( that, args ); 182 | } 183 | }, 184 | 185 | // Only normal processors (resolve) catch and reject exceptions 186 | process = special ? 187 | mightThrow : 188 | function() { 189 | try { 190 | mightThrow(); 191 | } catch ( e ) { 192 | 193 | if ( jQuery.Deferred.exceptionHook ) { 194 | jQuery.Deferred.exceptionHook( e, 195 | process.stackTrace ); 196 | } 197 | 198 | // Support: Promises/A+ section 2.3.3.3.4.1 199 | // https://promisesaplus.com/#point-61 200 | // Ignore post-resolution exceptions 201 | if ( depth + 1 >= maxDepth ) { 202 | 203 | // Only substitute handlers pass on context 204 | // and multiple values (non-spec behavior) 205 | if ( handler !== Thrower ) { 206 | that = undefined; 207 | args = [ e ]; 208 | } 209 | 210 | deferred.rejectWith( that, args ); 211 | } 212 | } 213 | }; 214 | 215 | // Support: Promises/A+ section 2.3.3.3.1 216 | // https://promisesaplus.com/#point-57 217 | // Re-resolve promises immediately to dodge false rejection from 218 | // subsequent errors 219 | if ( depth ) { 220 | process(); 221 | } else { 222 | 223 | // Call an optional hook to record the stack, in case of exception 224 | // since it's otherwise lost when execution goes async 225 | if ( jQuery.Deferred.getStackHook ) { 226 | process.stackTrace = jQuery.Deferred.getStackHook(); 227 | } 228 | window.setTimeout( process ); 229 | } 230 | }; 231 | } 232 | 233 | return jQuery.Deferred( function( newDefer ) { 234 | 235 | // progress_handlers.add( ... ) 236 | tuples[ 0 ][ 3 ].add( 237 | resolve( 238 | 0, 239 | newDefer, 240 | jQuery.isFunction( onProgress ) ? 241 | onProgress : 242 | Identity, 243 | newDefer.notifyWith 244 | ) 245 | ); 246 | 247 | // fulfilled_handlers.add( ... ) 248 | tuples[ 1 ][ 3 ].add( 249 | resolve( 250 | 0, 251 | newDefer, 252 | jQuery.isFunction( onFulfilled ) ? 253 | onFulfilled : 254 | Identity 255 | ) 256 | ); 257 | 258 | // rejected_handlers.add( ... ) 259 | tuples[ 2 ][ 3 ].add( 260 | resolve( 261 | 0, 262 | newDefer, 263 | jQuery.isFunction( onRejected ) ? 264 | onRejected : 265 | Thrower 266 | ) 267 | ); 268 | } ).promise(); 269 | }, 270 | 271 | // Get a promise for this deferred 272 | // If obj is provided, the promise aspect is added to the object 273 | promise: function( obj ) { 274 | return obj != null ? jQuery.extend( obj, promise ) : promise; 275 | } 276 | }, 277 | deferred = {}; 278 | 279 | // Add list-specific methods 280 | jQuery.each( tuples, function( i, tuple ) { 281 | var list = tuple[ 2 ], 282 | stateString = tuple[ 5 ]; 283 | 284 | // promise.progress = list.add 285 | // promise.done = list.add 286 | // promise.fail = list.add 287 | promise[ tuple[ 1 ] ] = list.add; 288 | 289 | // Handle state 290 | if ( stateString ) { 291 | list.add( 292 | function() { 293 | 294 | // state = "resolved" (i.e., fulfilled) 295 | // state = "rejected" 296 | state = stateString; 297 | }, 298 | 299 | // rejected_callbacks.disable 300 | // fulfilled_callbacks.disable 301 | tuples[ 3 - i ][ 2 ].disable, 302 | 303 | // progress_callbacks.lock 304 | tuples[ 0 ][ 2 ].lock 305 | ); 306 | } 307 | 308 | // progress_handlers.fire 309 | // fulfilled_handlers.fire 310 | // rejected_handlers.fire 311 | list.add( tuple[ 3 ].fire ); 312 | 313 | // deferred.notify = function() { deferred.notifyWith(...) } 314 | // deferred.resolve = function() { deferred.resolveWith(...) } 315 | // deferred.reject = function() { deferred.rejectWith(...) } 316 | deferred[ tuple[ 0 ] ] = function() { 317 | deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); 318 | return this; 319 | }; 320 | 321 | // deferred.notifyWith = list.fireWith 322 | // deferred.resolveWith = list.fireWith 323 | // deferred.rejectWith = list.fireWith 324 | deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 325 | } ); 326 | 327 | // Make the deferred a promise 328 | promise.promise( deferred ); 329 | 330 | // Call given func if any 331 | if ( func ) { 332 | func.call( deferred, deferred ); 333 | } 334 | 335 | // All done! 336 | return deferred; 337 | }, 338 | 339 | // Deferred helper 340 | when: function( singleValue ) { 341 | var 342 | 343 | // count of uncompleted subordinates 344 | remaining = arguments.length, 345 | 346 | // count of unprocessed arguments 347 | i = remaining, 348 | 349 | // subordinate fulfillment data 350 | resolveContexts = Array( i ), 351 | resolveValues = slice.call( arguments ), 352 | 353 | // the master Deferred 354 | master = jQuery.Deferred(), 355 | 356 | // subordinate callback factory 357 | updateFunc = function( i ) { 358 | return function( value ) { 359 | resolveContexts[ i ] = this; 360 | resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 361 | if ( !( --remaining ) ) { 362 | master.resolveWith( resolveContexts, resolveValues ); 363 | } 364 | }; 365 | }; 366 | 367 | // Single- and empty arguments are adopted like Promise.resolve 368 | if ( remaining <= 1 ) { 369 | adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject ); 370 | 371 | // Use .then() to unwrap secondary thenables (cf. gh-3000) 372 | if ( master.state() === "pending" || 373 | jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { 374 | 375 | return master.then(); 376 | } 377 | } 378 | 379 | // Multiple arguments are aggregated like Promise.all array elements 380 | while ( i-- ) { 381 | adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); 382 | } 383 | 384 | return master.promise(); 385 | } 386 | } ); 387 | 388 | return jQuery; 389 | } ); 390 | -------------------------------------------------------------------------------- /bower_components/jquery/src/css.js: -------------------------------------------------------------------------------- 1 | define( [ 2 | "./core", 3 | "./var/pnum", 4 | "./core/access", 5 | "./css/var/rmargin", 6 | "./var/document", 7 | "./var/rcssNum", 8 | "./css/var/rnumnonpx", 9 | "./css/var/cssExpand", 10 | "./css/var/getStyles", 11 | "./css/var/swap", 12 | "./css/curCSS", 13 | "./css/adjustCSS", 14 | "./css/addGetHookIf", 15 | "./css/support", 16 | 17 | "./core/init", 18 | "./core/ready", 19 | "./selector" // contains 20 | ], function( jQuery, pnum, access, rmargin, document, rcssNum, rnumnonpx, cssExpand, 21 | getStyles, swap, curCSS, adjustCSS, addGetHookIf, support ) { 22 | 23 | "use strict"; 24 | 25 | var 26 | 27 | // Swappable if display is none or starts with table 28 | // except "table", "table-cell", or "table-caption" 29 | // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 30 | rdisplayswap = /^(none|table(?!-c[ea]).+)/, 31 | cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 32 | cssNormalTransform = { 33 | letterSpacing: "0", 34 | fontWeight: "400" 35 | }, 36 | 37 | cssPrefixes = [ "Webkit", "Moz", "ms" ], 38 | emptyStyle = document.createElement( "div" ).style; 39 | 40 | // Return a css property mapped to a potentially vendor prefixed property 41 | function vendorPropName( name ) { 42 | 43 | // Shortcut for names that are not vendor prefixed 44 | if ( name in emptyStyle ) { 45 | return name; 46 | } 47 | 48 | // Check for vendor prefixed names 49 | var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), 50 | i = cssPrefixes.length; 51 | 52 | while ( i-- ) { 53 | name = cssPrefixes[ i ] + capName; 54 | if ( name in emptyStyle ) { 55 | return name; 56 | } 57 | } 58 | } 59 | 60 | function setPositiveNumber( elem, value, subtract ) { 61 | 62 | // Any relative (+/-) values have already been 63 | // normalized at this point 64 | var matches = rcssNum.exec( value ); 65 | return matches ? 66 | 67 | // Guard against undefined "subtract", e.g., when used as in cssHooks 68 | Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : 69 | value; 70 | } 71 | 72 | function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { 73 | var i = extra === ( isBorderBox ? "border" : "content" ) ? 74 | 75 | // If we already have the right measurement, avoid augmentation 76 | 4 : 77 | 78 | // Otherwise initialize for horizontal or vertical properties 79 | name === "width" ? 1 : 0, 80 | 81 | val = 0; 82 | 83 | for ( ; i < 4; i += 2 ) { 84 | 85 | // Both box models exclude margin, so add it if we want it 86 | if ( extra === "margin" ) { 87 | val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); 88 | } 89 | 90 | if ( isBorderBox ) { 91 | 92 | // border-box includes padding, so remove it if we want content 93 | if ( extra === "content" ) { 94 | val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 95 | } 96 | 97 | // At this point, extra isn't border nor margin, so remove border 98 | if ( extra !== "margin" ) { 99 | val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 100 | } 101 | } else { 102 | 103 | // At this point, extra isn't content, so add padding 104 | val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 105 | 106 | // At this point, extra isn't content nor padding, so add border 107 | if ( extra !== "padding" ) { 108 | val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 109 | } 110 | } 111 | } 112 | 113 | return val; 114 | } 115 | 116 | function getWidthOrHeight( elem, name, extra ) { 117 | 118 | // Start with offset property, which is equivalent to the border-box value 119 | var val, 120 | valueIsBorderBox = true, 121 | styles = getStyles( elem ), 122 | isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 123 | 124 | // Support: IE <=11 only 125 | // Running getBoundingClientRect on a disconnected node 126 | // in IE throws an error. 127 | if ( elem.getClientRects().length ) { 128 | val = elem.getBoundingClientRect()[ name ]; 129 | } 130 | 131 | // Some non-html elements return undefined for offsetWidth, so check for null/undefined 132 | // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 133 | // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 134 | if ( val <= 0 || val == null ) { 135 | 136 | // Fall back to computed then uncomputed css if necessary 137 | val = curCSS( elem, name, styles ); 138 | if ( val < 0 || val == null ) { 139 | val = elem.style[ name ]; 140 | } 141 | 142 | // Computed unit is not pixels. Stop here and return. 143 | if ( rnumnonpx.test( val ) ) { 144 | return val; 145 | } 146 | 147 | // Check for style in case a browser which returns unreliable values 148 | // for getComputedStyle silently falls back to the reliable elem.style 149 | valueIsBorderBox = isBorderBox && 150 | ( support.boxSizingReliable() || val === elem.style[ name ] ); 151 | 152 | // Normalize "", auto, and prepare for extra 153 | val = parseFloat( val ) || 0; 154 | } 155 | 156 | // Use the active box-sizing model to add/subtract irrelevant styles 157 | return ( val + 158 | augmentWidthOrHeight( 159 | elem, 160 | name, 161 | extra || ( isBorderBox ? "border" : "content" ), 162 | valueIsBorderBox, 163 | styles 164 | ) 165 | ) + "px"; 166 | } 167 | 168 | jQuery.extend( { 169 | 170 | // Add in style property hooks for overriding the default 171 | // behavior of getting and setting a style property 172 | cssHooks: { 173 | opacity: { 174 | get: function( elem, computed ) { 175 | if ( computed ) { 176 | 177 | // We should always get a number back from opacity 178 | var ret = curCSS( elem, "opacity" ); 179 | return ret === "" ? "1" : ret; 180 | } 181 | } 182 | } 183 | }, 184 | 185 | // Don't automatically add "px" to these possibly-unitless properties 186 | cssNumber: { 187 | "animationIterationCount": true, 188 | "columnCount": true, 189 | "fillOpacity": true, 190 | "flexGrow": true, 191 | "flexShrink": true, 192 | "fontWeight": true, 193 | "lineHeight": true, 194 | "opacity": true, 195 | "order": true, 196 | "orphans": true, 197 | "widows": true, 198 | "zIndex": true, 199 | "zoom": true 200 | }, 201 | 202 | // Add in properties whose names you wish to fix before 203 | // setting or getting the value 204 | cssProps: { 205 | "float": "cssFloat" 206 | }, 207 | 208 | // Get and set the style property on a DOM Node 209 | style: function( elem, name, value, extra ) { 210 | 211 | // Don't set styles on text and comment nodes 212 | if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 213 | return; 214 | } 215 | 216 | // Make sure that we're working with the right name 217 | var ret, type, hooks, 218 | origName = jQuery.camelCase( name ), 219 | style = elem.style; 220 | 221 | name = jQuery.cssProps[ origName ] || 222 | ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); 223 | 224 | // Gets hook for the prefixed version, then unprefixed version 225 | hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 226 | 227 | // Check if we're setting a value 228 | if ( value !== undefined ) { 229 | type = typeof value; 230 | 231 | // Convert "+=" or "-=" to relative numbers (#7345) 232 | if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 233 | value = adjustCSS( elem, name, ret ); 234 | 235 | // Fixes bug #9237 236 | type = "number"; 237 | } 238 | 239 | // Make sure that null and NaN values aren't set (#7116) 240 | if ( value == null || value !== value ) { 241 | return; 242 | } 243 | 244 | // If a number was passed in, add the unit (except for certain CSS properties) 245 | if ( type === "number" ) { 246 | value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 247 | } 248 | 249 | // background-* props affect original clone's values 250 | if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 251 | style[ name ] = "inherit"; 252 | } 253 | 254 | // If a hook was provided, use that value, otherwise just set the specified value 255 | if ( !hooks || !( "set" in hooks ) || 256 | ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 257 | 258 | style[ name ] = value; 259 | } 260 | 261 | } else { 262 | 263 | // If a hook was provided get the non-computed value from there 264 | if ( hooks && "get" in hooks && 265 | ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 266 | 267 | return ret; 268 | } 269 | 270 | // Otherwise just get the value from the style object 271 | return style[ name ]; 272 | } 273 | }, 274 | 275 | css: function( elem, name, extra, styles ) { 276 | var val, num, hooks, 277 | origName = jQuery.camelCase( name ); 278 | 279 | // Make sure that we're working with the right name 280 | name = jQuery.cssProps[ origName ] || 281 | ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); 282 | 283 | // Try prefixed name followed by the unprefixed name 284 | hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 285 | 286 | // If a hook was provided get the computed value from there 287 | if ( hooks && "get" in hooks ) { 288 | val = hooks.get( elem, true, extra ); 289 | } 290 | 291 | // Otherwise, if a way to get the computed value exists, use that 292 | if ( val === undefined ) { 293 | val = curCSS( elem, name, styles ); 294 | } 295 | 296 | // Convert "normal" to computed value 297 | if ( val === "normal" && name in cssNormalTransform ) { 298 | val = cssNormalTransform[ name ]; 299 | } 300 | 301 | // Make numeric if forced or a qualifier was provided and val looks numeric 302 | if ( extra === "" || extra ) { 303 | num = parseFloat( val ); 304 | return extra === true || isFinite( num ) ? num || 0 : val; 305 | } 306 | return val; 307 | } 308 | } ); 309 | 310 | jQuery.each( [ "height", "width" ], function( i, name ) { 311 | jQuery.cssHooks[ name ] = { 312 | get: function( elem, computed, extra ) { 313 | if ( computed ) { 314 | 315 | // Certain elements can have dimension info if we invisibly show them 316 | // but it must have a current display style that would benefit 317 | return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 318 | 319 | // Support: Safari 8+ 320 | // Table columns in Safari have non-zero offsetWidth & zero 321 | // getBoundingClientRect().width unless display is changed. 322 | // Support: IE <=11 only 323 | // Running getBoundingClientRect on a disconnected node 324 | // in IE throws an error. 325 | ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? 326 | swap( elem, cssShow, function() { 327 | return getWidthOrHeight( elem, name, extra ); 328 | } ) : 329 | getWidthOrHeight( elem, name, extra ); 330 | } 331 | }, 332 | 333 | set: function( elem, value, extra ) { 334 | var matches, 335 | styles = extra && getStyles( elem ), 336 | subtract = extra && augmentWidthOrHeight( 337 | elem, 338 | name, 339 | extra, 340 | jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 341 | styles 342 | ); 343 | 344 | // Convert to pixels if value adjustment is needed 345 | if ( subtract && ( matches = rcssNum.exec( value ) ) && 346 | ( matches[ 3 ] || "px" ) !== "px" ) { 347 | 348 | elem.style[ name ] = value; 349 | value = jQuery.css( elem, name ); 350 | } 351 | 352 | return setPositiveNumber( elem, value, subtract ); 353 | } 354 | }; 355 | } ); 356 | 357 | jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 358 | function( elem, computed ) { 359 | if ( computed ) { 360 | return ( parseFloat( curCSS( elem, "marginLeft" ) ) || 361 | elem.getBoundingClientRect().left - 362 | swap( elem, { marginLeft: 0 }, function() { 363 | return elem.getBoundingClientRect().left; 364 | } ) 365 | ) + "px"; 366 | } 367 | } 368 | ); 369 | 370 | // These hooks are used by animate to expand properties 371 | jQuery.each( { 372 | margin: "", 373 | padding: "", 374 | border: "Width" 375 | }, function( prefix, suffix ) { 376 | jQuery.cssHooks[ prefix + suffix ] = { 377 | expand: function( value ) { 378 | var i = 0, 379 | expanded = {}, 380 | 381 | // Assumes a single number if not a string 382 | parts = typeof value === "string" ? value.split( " " ) : [ value ]; 383 | 384 | for ( ; i < 4; i++ ) { 385 | expanded[ prefix + cssExpand[ i ] + suffix ] = 386 | parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 387 | } 388 | 389 | return expanded; 390 | } 391 | }; 392 | 393 | if ( !rmargin.test( prefix ) ) { 394 | jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 395 | } 396 | } ); 397 | 398 | jQuery.fn.extend( { 399 | css: function( name, value ) { 400 | return access( this, function( elem, name, value ) { 401 | var styles, len, 402 | map = {}, 403 | i = 0; 404 | 405 | if ( jQuery.isArray( name ) ) { 406 | styles = getStyles( elem ); 407 | len = name.length; 408 | 409 | for ( ; i < len; i++ ) { 410 | map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 411 | } 412 | 413 | return map; 414 | } 415 | 416 | return value !== undefined ? 417 | jQuery.style( elem, name, value ) : 418 | jQuery.css( elem, name ); 419 | }, name, value, arguments.length > 1 ); 420 | } 421 | } ); 422 | 423 | return jQuery; 424 | } ); 425 | --------------------------------------------------------------------------------