Skip to content

Commit

Permalink
Build: Put all AMD modules in "src/" in strict mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mgol committed Apr 25, 2016
1 parent e2d1142 commit 305f193
Show file tree
Hide file tree
Showing 99 changed files with 195 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/.jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"immed": true,
"noarg": true,
"quotmark": "double",
"strict": true,
"undef": true,
"unused": true,

Expand Down
2 changes: 2 additions & 0 deletions src/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ define( [
"./serialize" // jQuery.param
], function( jQuery, document, rnotwhite, location, nonce, rquery ) {

"use strict";

var
r20 = /%20/g,
rhash = /#.*$/,
Expand Down
2 changes: 2 additions & 0 deletions src/ajax/jsonp.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ define( [
"../ajax"
], function( jQuery, nonce, rquery ) {

"use strict";

var oldCallbacks = [],
rjsonp = /(=)\?(?=&|$)|\?\?/;

Expand Down
2 changes: 2 additions & 0 deletions src/ajax/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ define( [
"../selector"
], function( jQuery ) {

"use strict";

/**
* Load a url into a page
*/
Expand Down
2 changes: 2 additions & 0 deletions src/ajax/parseXML.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ define( [
"../core"
], function( jQuery ) {

"use strict";

// Cross-browser xml parsing
jQuery.parseXML = function( data ) {
var xml;
Expand Down
2 changes: 2 additions & 0 deletions src/ajax/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ define( [
"../ajax"
], function( jQuery, document ) {

"use strict";

// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
jQuery.ajaxPrefilter( function( s ) {
if ( s.crossDomain ) {
Expand Down
2 changes: 2 additions & 0 deletions src/ajax/var/location.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
define( function() {
"use strict";

return window.location;
} );
2 changes: 2 additions & 0 deletions src/ajax/var/nonce.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
define( [
"../../core"
], function( jQuery ) {
"use strict";

return jQuery.now();
} );
2 changes: 2 additions & 0 deletions src/ajax/var/rquery.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
define( function() {
"use strict";

return ( /\?/ );
} );
2 changes: 2 additions & 0 deletions src/ajax/xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ define( [
"../ajax"
], function( jQuery, support ) {

"use strict";

jQuery.ajaxSettings.xhr = function() {
try {
return new window.XMLHttpRequest();
Expand Down
2 changes: 2 additions & 0 deletions src/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ define( [
"./attributes/val"
], function( jQuery ) {

"use strict";

// Return jQuery for attributes-only inclusion
return jQuery;
} );
2 changes: 2 additions & 0 deletions src/attributes/attr.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ define( [
"../selector"
], function( jQuery, access, support, rnotwhite ) {

"use strict";

var boolHook,
attrHandle = jQuery.expr.attrHandle;

Expand Down
2 changes: 2 additions & 0 deletions src/attributes/classes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ define( [
"../core/init"
], function( jQuery, rnotwhite, dataPriv ) {

"use strict";

var rclass = /[\t\r\n\f]/g;

function getClass( elem ) {
Expand Down
2 changes: 2 additions & 0 deletions src/attributes/prop.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ define( [
"../selector"
], function( jQuery, access, support ) {

"use strict";

var rfocusable = /^(?:input|select|textarea|button)$/i,
rclickable = /^(?:a|area)$/i;

Expand Down
2 changes: 2 additions & 0 deletions src/attributes/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ define( [
"../var/support"
], function( document, support ) {

"use strict";

( function() {
var input = document.createElement( "input" ),
select = document.createElement( "select" ),
Expand Down
2 changes: 2 additions & 0 deletions src/attributes/val.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ define( [
"../core/init"
], function( jQuery, support ) {

"use strict";

var rreturn = /\r/g,
rspaces = /[\x20\t\r\n\f]+/g;

Expand Down
2 changes: 2 additions & 0 deletions src/callbacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ define( [
"./var/rnotwhite"
], function( jQuery, rnotwhite ) {

"use strict";

// Convert String-formatted options into Object-formatted ones
function createOptions( options ) {
var object = {};
Expand Down
2 changes: 2 additions & 0 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ define( [
class2type, toString, hasOwn, fnToString, ObjectFunctionString,
support, DOMEval ) {

"use strict";

var
version = "@VERSION",

Expand Down
2 changes: 2 additions & 0 deletions src/core/DOMEval.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
define( [
"../var/document"
], function( document ) {
"use strict";

function DOMEval( code, doc ) {
doc = doc || document;

Expand Down
2 changes: 2 additions & 0 deletions src/core/access.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ define( [
"../core"
], function( jQuery ) {

"use strict";

// Multifunctional method to get and set values of a collection
// The value/s can optionally be executed if it's a function
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
Expand Down
2 changes: 2 additions & 0 deletions src/core/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ define( [
"../traversing/findFilter"
], function( jQuery, document, rsingleTag ) {

"use strict";

// A central reference to the root jQuery(document)
var rootjQuery,

Expand Down
2 changes: 2 additions & 0 deletions src/core/parseHTML.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ define( [
"./support"
], function( jQuery, document, rsingleTag, buildFragment, support ) {

"use strict";

// Argument "data" should be string of html
// context (optional): If specified, the fragment will be created in this context,
// defaults to document
Expand Down
2 changes: 2 additions & 0 deletions src/core/ready-no-deferred.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ define( [
"../var/document"
], function( jQuery, document ) {

"use strict";

var readyCallbacks = [],
readyFiring = false,
whenReady = function( fn ) {
Expand Down
2 changes: 2 additions & 0 deletions src/core/ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ define( [
"../deferred"
], function( jQuery, document ) {

"use strict";

// The deferred used on DOM ready
var readyList = jQuery.Deferred();

Expand Down
2 changes: 2 additions & 0 deletions src/core/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ define( [
"../var/support"
], function( document, support ) {

"use strict";

// Support: Safari 8 only
// In Safari 8 documents created via document.implementation.createHTMLDocument
// collapse sibling forms: the second one becomes a child of the first one.
Expand Down
1 change: 1 addition & 0 deletions src/core/var/rsingleTag.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
define( function() {
"use strict";

// Match a standalone tag
return ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
Expand Down
2 changes: 2 additions & 0 deletions src/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ define( [
], function( jQuery, pnum, access, rmargin, document, rcssNum, rnumnonpx, cssExpand,
getStyles, swap, curCSS, adjustCSS, addGetHookIf, support ) {

"use strict";

var

// Swappable if display is none or starts with table
Expand Down
2 changes: 2 additions & 0 deletions src/css/addGetHookIf.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
define( function() {

"use strict";

function addGetHookIf( conditionFn, hookFn ) {

// Define the hook, we'll check on the first run if it's really needed.
Expand Down
2 changes: 2 additions & 0 deletions src/css/adjustCSS.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ define( [
"../var/rcssNum"
], function( jQuery, rcssNum ) {

"use strict";

function adjustCSS( elem, prop, valueParts, tween ) {
var adjusted,
scale = 1,
Expand Down
2 changes: 2 additions & 0 deletions src/css/curCSS.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ define( [
"../selector" // Get jQuery.contains
], function( jQuery, rnumnonpx, rmargin, getStyles, support ) {

"use strict";

function curCSS( elem, name, computed ) {
var width, minWidth, maxWidth, ret,
style = elem.style;
Expand Down
2 changes: 2 additions & 0 deletions src/css/hiddenVisibleSelectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ define( [
"../selector"
], function( jQuery ) {

"use strict";

jQuery.expr.pseudos.hidden = function( elem ) {
return !jQuery.expr.pseudos.visible( elem );
};
Expand Down
2 changes: 2 additions & 0 deletions src/css/showHide.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ define( [
"../css/var/isHiddenWithinTree"
], function( jQuery, dataPriv, isHiddenWithinTree ) {

"use strict";

var defaultDisplayMap = {};

function getDefaultDisplay( elem ) {
Expand Down
2 changes: 2 additions & 0 deletions src/css/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ define( [
"../var/support"
], function( jQuery, document, documentElement, support ) {

"use strict";

( function() {

// Executing both pixelPosition & boxSizingReliable tests require only one layout
Expand Down
2 changes: 2 additions & 0 deletions src/css/var/cssExpand.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
define( function() {
"use strict";

return [ "Top", "Right", "Bottom", "Left" ];
} );
2 changes: 2 additions & 0 deletions src/css/var/getStyles.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
define( function() {
"use strict";

return function( elem ) {

// Support: IE <=11 only, Firefox <=30 (#15098, #14150)
Expand Down
1 change: 1 addition & 0 deletions src/css/var/isHiddenWithinTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ define( [

// css is assumed
], function( jQuery ) {
"use strict";

// isHiddenWithinTree reports if an element has a non-"none" display style (inline and/or
// through the CSS cascade), which is useful in deciding whether or not to make it visible.
Expand Down
2 changes: 2 additions & 0 deletions src/css/var/rmargin.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
define( function() {
"use strict";

return ( /^margin/ );
} );
2 changes: 2 additions & 0 deletions src/css/var/rnumnonpx.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
define( [
"../../var/pnum"
], function( pnum ) {
"use strict";

return new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
} );
2 changes: 2 additions & 0 deletions src/css/var/swap.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
define( function() {

"use strict";

// A method for quickly swapping in/out CSS properties to get correct calculations.
return function( elem, options, callback, args ) {
var ret, name,
Expand Down
2 changes: 2 additions & 0 deletions src/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ define( [
"./data/var/dataUser"
], function( jQuery, access, dataPriv, dataUser ) {

"use strict";

// Implementation Summary
//
// 1. Enforce API surface and semantic compatibility with 1.9.x branch
Expand Down
2 changes: 2 additions & 0 deletions src/data/Data.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ define( [
"./var/acceptData"
], function( jQuery, rnotwhite, acceptData ) {

"use strict";

function Data() {
this.expando = jQuery.expando + Data.uid++;
}
Expand Down
2 changes: 2 additions & 0 deletions src/data/var/acceptData.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
define( function() {

"use strict";

/**
* Determines whether an object can have data
*/
Expand Down
2 changes: 2 additions & 0 deletions src/data/var/dataPriv.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
define( [
"../Data"
], function( Data ) {
"use strict";

return new Data();
} );
2 changes: 2 additions & 0 deletions src/data/var/dataUser.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
define( [
"../Data"
], function( Data ) {
"use strict";

return new Data();
} );
2 changes: 2 additions & 0 deletions src/deferred/exceptionHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ define( [
"../deferred"
], function( jQuery ) {

"use strict";

// These usually indicate a programmer mistake during development,
// warn about them ASAP rather than swallowing them by default.
var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
Expand Down
2 changes: 2 additions & 0 deletions src/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ define( [
"./core"
], function( jQuery ) {

"use strict";

jQuery.fn.extend( {

bind: function( types, data, fn ) {
Expand Down
2 changes: 2 additions & 0 deletions src/dimensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ define( [
"./css"
], function( jQuery, access ) {

"use strict";

// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
Expand Down
Loading

0 comments on commit 305f193

Please sign in to comment.