Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
cowboy committed Feb 11, 2010
1 parent 1b96565 commit 41c7746
Show file tree
Hide file tree
Showing 15 changed files with 6,364 additions and 122 deletions.
4 changes: 2 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# jQuery resize event #
[http://benalman.com/projects/jquery-resize-plugin/](http://benalman.com/projects/jquery-resize-plugin/)

Version: 1.0, Last updated: 2/9/2010
Version: 1.0, Last updated: 2/10/2010

With jQuery resize event, you can bind resize event handlers to elements other than window, for super-awesome-resizing-greatness!

Expand Down Expand Up @@ -37,7 +37,7 @@ Internet Explorer 6-8, Firefox 2-3.6, Safari 3-4, Chrome, Opera 9.6-10.1.

## Release History ##

1.0 - (2/9/2010) Pre-Initial release
1.0 - (2/10/2010) Initial release


## License ##
Expand Down
12 changes: 6 additions & 6 deletions docs/files/jquery-ba-resize-js.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index/Files.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<div id=Index><div class=IPageTitle>File Index</div><div class=INavigationBar>$#! &middot; 0-9 &middot; A &middot; B &middot; C &middot; D &middot; E &middot; F &middot; G &middot; H &middot; I &middot; <a href="#J">J</a> &middot; K &middot; L &middot; M &middot; N &middot; O &middot; P &middot; Q &middot; R &middot; S &middot; T &middot; U &middot; V &middot; W &middot; X &middot; Y &middot; Z</div><table border=0 cellspacing=0 cellpadding=0><tr><td class=IHeading id=IFirstHeading><a name="J"></a>J</td><td></td></tr><tr><td class=ISymbolPrefix id=IOnlySymbolPrefix>&nbsp;</td><td class=IEntry><a href="../files/jquery-ba-resize-js.html#jQuery_resize_event" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')" class=ISymbol>jQuery resize event</a></td></tr></table>
<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CFile><b>Version: 1.0, Last updated: 2/9/2010</b></div></div><!--END_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CFile><b>Version: 1.0, Last updated: 2/10/2010</b></div></div><!--END_ND_TOOLTIPS-->

</div><!--Index-->

Expand Down
2 changes: 1 addition & 1 deletion docs/index/General.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt3"><div class=CFile><b>Version: 1.0, Last updated: 2/9/2010</b></div></div><!--END_ND_TOOLTIPS-->
<div class=CToolTip id="tt3"><div class=CFile><b>Version: 1.0, Last updated: 2/10/2010</b></div></div><!--END_ND_TOOLTIPS-->


<!--START_ND_TOOLTIPS-->
Expand Down
4 changes: 2 additions & 2 deletions docs/nd/Data/FileInfo.nd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1.4
JavaScript
/srv/projects/jquery-resize/jquery.ba-resize.min.js 1265775871 0 /srv/projects/jquery-resize/jquery.ba-resize.min.js
/srv/projects/jquery-resize/jquery.ba-resize.js 1265775868 1 jQuery resize event
/srv/projects/jquery-resize/jquery.ba-resize.min.js 1265856013 0 /srv/projects/jquery-resize/jquery.ba-resize.min.js
/srv/projects/jquery-resize/jquery.ba-resize.js 1265855990 1 jQuery resize event
Binary file modified docs/nd/Data/SymbolTable.nd
Binary file not shown.
4 changes: 2 additions & 2 deletions examples/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
$shell['h3'] = ob_get_contents();
ob_end_clean();

$shell['jquery'] = 'jquery-1.4.2pre.js';
//$shell['jquery'] = 'jquery-1.4.1.js';
//$shell['jquery'] = 'jquery-1.4.2pre.js';
$shell['jquery'] = 'jquery-1.4.1.js';
//$shell['jquery'] = 'jquery-1.3.2.js';

$shell['shBrush'] = array( 'JScript' );
Expand Down
16 changes: 9 additions & 7 deletions jquery.ba-resize.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jQuery resize event - v1.0 - 2/9/2010
* jQuery resize event - v1.0 - 2/10/2010
* http://benalman.com/projects/jquery-resize-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
Expand All @@ -9,7 +9,7 @@

// Script: jQuery resize event
//
// *Version: 1.0, Last updated: 2/9/2010*
// *Version: 1.0, Last updated: 2/10/2010*
//
// Project Home - http://benalman.com/projects/jquery-resize-plugin/
// GitHub - http://github.com/cowboy/jquery-resize/
Expand All @@ -35,13 +35,13 @@
// tested with, what browsers it has been tested in, and where the unit tests
// reside (so you can test it yourself).
//
// jQuery Versions - 1.3.2, 1.4.1, 1.4.2pre
// jQuery Versions - 1.3.2, 1.4.1
// Browsers Tested - Internet Explorer 6-8, Firefox 2-3.6, Safari 3-4, Chrome, Opera 9.6-10.1.
// Unit Tests - http://benalman.com/code/projects/jquery-resize/unit/
//
// About: Release History
//
// 1.0 - (2/9/2010) Initial release
// 1.0 - (2/10/2010) Initial release

(function($,window,undefined){
'$:nomunge'; // Used by YUI compressor.
Expand Down Expand Up @@ -78,7 +78,7 @@
// provided by this plugin, and its execution can be left entirely up to the
// browser. However, since certain browsers fire the resize event continuously
// while others do not, enabling this will throttle the window resize event,
// making event behavior consistent across all elements.
// making event behavior consistent across all elements in all browsers.
//
// While setting this property to false will disable window object resize
// event throttling, please note that this property must be changed before any
Expand All @@ -91,7 +91,8 @@
// Fired when an element's width or height changes. Because browsers only
// provide this event for the window element, for other elements a polling
// loop is initialized, running every <jQuery.resize.delay> milliseconds
// to see if elements' dimensions have changed.
// to see if elements' dimensions have changed. You may bind with either
// .resize( fn ) or .bind( "resize", fn ), and unbind with .unbind( "resize" ).
//
// Usage:
//
Expand All @@ -103,7 +104,8 @@
// Additional Notes:
//
// * The polling loop is not created until at least one callback is actually
// bound to 'resize', and a single polling loop is shared for all elements.
// bound to the 'resize' event, and this single polling loop is shared
// across all elements.
//
// Double firing issue in jQuery 1.3.2:
//
Expand Down
2 changes: 1 addition & 1 deletion jquery.ba-resize.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

173 changes: 86 additions & 87 deletions shared/jquery-1.4.2pre.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
console.log("Don't hose Mike Taylor's server! Download the file and test locally, thanks!");

/*!
* jQuery JavaScript Library v1.4.2pre
* http://jquery.com/
Expand All @@ -13,7 +11,7 @@ console.log("Don't hose Mike Taylor's server! Download the file and test locally
* Copyright 2010, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
* Date: Sat Feb 6 10:43:10 2010 +0800
* Date: Mon Feb 8 23:28:15 2010 -0500
*/
(function( window, undefined ) {

Expand Down Expand Up @@ -1916,7 +1914,7 @@ jQuery.event = {
event.currentTarget = this;

// Namespaced event handlers
all = event.type.indexOf(".") < 0;
all = event.type.indexOf(".") < 0 && !event.exclusive;

if ( !all ) {
namespaces = event.type.split(".");
Expand All @@ -1934,7 +1932,7 @@ jQuery.event = {
var handleObj = handlers[ j ];

// Filter the functions by class
if ( (all && !event.exclusive) || namespace.test( handleObj.namespace ) ) {
if ( all || namespace.test( handleObj.namespace ) ) {
// Pass in a reference to the handler function itself
// So that we can later remove it
event.handler = handleObj.handler;
Expand Down Expand Up @@ -2206,64 +2204,66 @@ jQuery.each({
// submit delegation
if ( !jQuery.support.submitBubbles ) {

jQuery.event.special.submit = {
setup: function( data, namespaces ) {
if ( this.nodeName.toLowerCase() !== "form" ) {
jQuery.event.add(this, "click.specialSubmit", function( e ) {
var elem = e.target, type = elem.type;
jQuery.event.special.submit = {
setup: function( data, namespaces ) {
if ( this.nodeName.toLowerCase() !== "form" ) {
jQuery.event.add(this, "click.specialSubmit", function( e ) {
var elem = e.target, type = elem.type;

if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
return trigger( "submit", this, arguments );
}
});
if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
return trigger( "submit", this, arguments );
}
});

jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
var elem = e.target, type = elem.type;
jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
var elem = e.target, type = elem.type;

if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
return trigger( "submit", this, arguments );
}
});
if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
return trigger( "submit", this, arguments );
}
});

} else {
return false;
}
},
} else {
return false;
}
},

teardown: function( namespaces ) {
jQuery.event.remove( this, "click.specialSubmit" );
jQuery.event.remove( this, "keypress.specialSubmit" );
}
};
teardown: function( namespaces ) {
jQuery.event.remove( this, "click.specialSubmit" );
jQuery.event.remove( this, "keypress.specialSubmit" );
}
};

}

// change delegation, happens here so we have bind.
if ( !jQuery.support.changeBubbles ) {

var formElems = /textarea|input|select/i;
var formElems = /textarea|input|select/i,

function getVal( elem ) {
var type = elem.type, val = elem.value;
changeFilters,

if ( type === "radio" || type === "checkbox" ) {
val = elem.checked;
getVal = function( elem ) {
var type = elem.type, val = elem.value;

} else if ( type === "select-multiple" ) {
val = elem.selectedIndex > -1 ?
jQuery.map( elem.options, function( elem ) {
return elem.selected;
}).join("-") :
"";
if ( type === "radio" || type === "checkbox" ) {
val = elem.checked;

} else if ( elem.nodeName.toLowerCase() === "select" ) {
val = elem.selectedIndex;
}
} else if ( type === "select-multiple" ) {
val = elem.selectedIndex > -1 ?
jQuery.map( elem.options, function( elem ) {
return elem.selected;
}).join("-") :
"";

return val;
}
} else if ( elem.nodeName.toLowerCase() === "select" ) {
val = elem.selectedIndex;
}

function testChange( e ) {
return val;
},

testChange = function testChange( e ) {
var elem = e.target, data, val;

if ( !formElems.test( elem.nodeName ) || elem.readOnly ) {
Expand All @@ -2286,60 +2286,59 @@ function testChange( e ) {
e.type = "change";
return jQuery.event.trigger( e, arguments[1], elem );
}
}
};

jQuery.event.special.change = {
filters: {
focusout: testChange,
jQuery.event.special.change = {
filters: {
focusout: testChange,

click: function( e ) {
var elem = e.target, type = elem.type;
click: function( e ) {
var elem = e.target, type = elem.type;

if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
return testChange.call( this, e );
}
},
if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
return testChange.call( this, e );
}
},

// Change has to be called before submit
// Keydown will be called before keypress, which is used in submit-event delegation
keydown: function( e ) {
var elem = e.target, type = elem.type;
// Change has to be called before submit
// Keydown will be called before keypress, which is used in submit-event delegation
keydown: function( e ) {
var elem = e.target, type = elem.type;

if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
type === "select-multiple" ) {
return testChange.call( this, e );
}
},

if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
type === "select-multiple" ) {
return testChange.call( this, e );
// Beforeactivate happens also before the previous element is blurred
// with this event you can't trigger a change event, but you can store
// information/focus[in] is not needed anymore
beforeactivate: function( e ) {
var elem = e.target;
jQuery.data( elem, "_change_data", getVal(elem) );
}
},

// Beforeactivate happens also before the previous element is blurred
// with this event you can't trigger a change event, but you can store
// information/focus[in] is not needed anymore
beforeactivate: function( e ) {
var elem = e.target;
jQuery.data( elem, "_change_data", getVal(elem) );
}
},
setup: function( data, namespaces ) {
for ( var type in changeFilters ) {
jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
}

setup: function( data, namespaces ) {
for ( var type in changeFilters ) {
jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
}
return formElems.test( this.nodeName );
},

return formElems.test( this.nodeName );
},
teardown: function( namespaces ) {
for ( var type in changeFilters ) {
jQuery.event.remove( this, type + ".specialChange", changeFilters[type] );
}

teardown: function( namespaces ) {
for ( var type in changeFilters ) {
jQuery.event.remove( this, type + ".specialChange", changeFilters[type] );
return formElems.test( this.nodeName );
}
};

return formElems.test( this.nodeName );
}
};

var changeFilters = jQuery.event.special.change.filters;

changeFilters = jQuery.event.special.change.filters;
}

function trigger( type, elem, args ) {
Expand Down
Loading

0 comments on commit 41c7746

Please sign in to comment.