Skip to content
Permalink
Browse files

New plugins for 1.6: Fixed headers and indentation.

  • Loading branch information
scottgonzalez committed Jul 10, 2008
1 parent 4f412c6 commit 12cdae02b136f7a542dfac7319d008cf9c3d5505
Showing with 546 additions and 532 deletions.
  1. +10 −13 ui/ui.autocomplete.js
  2. +87 −92 ui/ui.history.js
  3. +155 −143 ui/ui.magnifier.js
  4. +173 −175 ui/ui.progressbar.js
  5. +121 −109 ui/ui.spinner.js
@@ -1,18 +1,16 @@
/*
* Autocomplete - jQuery plugin 1.0.1
* jQuery UI Autocomplete
*
* Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id: jquery.autocomplete.js 5698 2008-05-27 13:53:30Z paul.bakaus $
* Copyright (c) 2007, 2008 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Autocomplete
*
* Depends:
* ui.core.js
*/

;(function($) {

(function($) {

$.widget("ui.autocomplete", {

@@ -47,7 +45,6 @@ $.widget("ui.autocomplete", {

});


$.Autocompleter = function(input, options) {

var KEY = {
@@ -772,4 +769,4 @@ $.Autocompleter.Selection = function(field, start, end) {
field.focus();
};

})(jQuery);
})(jQuery);
@@ -7,111 +7,106 @@
*
* http://docs.jquery.com/UI/History
*
* Revision: $Id: ui.history.js 5218 2008-04-09 20:08:24Z rdworth $
* Depends:
* ui.core.js
*/
;(function($) {
(function($) {

// if the UI scope is not availalable, add it
$.ui = $.ui || {};
// TODO lazy loading singleton
$.ui.hmanager = new function() {
var states = {}, def = function() {};

// TODO lazy loading singleton
$.ui.hmanager = new function() {
var states = {}, def = function() {};

var $window = $(window), hash = location.hash;

function getState() {
return hash.replace('#', '');
}

var iframe;
// var keepHistoryIn = iframe || window;

return {
var $window = $(window), hash = location.hash;

enable: function() {

if ($.browser.msie && parseInt($.browser.version) < 8) {
$(function() {
// create hidden iframe for hash change tracking
iframe = $('<iframe id="ui-history-iframe" style="display: none;"></iframe>').
prependTo(document.body)[0];

// create initial history entry
iframe.contentWindow.document.open();
iframe.contentWindow.document.close();

if (getState())
iframe.contentWindow.document.location.hash = getState();

});
}

$window.bind('hashchange', function(e) {
// Prevent IE 8 from fireing an event twice,
// one from true event, one from trigger...
if (!iframe && hash == location.hash || iframe && hash == iframe.contentWindow.document.location.hash)
return false;
function getState() {
return hash.replace('#', '');
}

var iframe;
// var keepHistoryIn = iframe || window;

return {

if ($.browser.msie && parseInt($.browser.version) < 8) {
hash = iframe.contentWindow.document.location.hash;
}
else
hash = location.hash;
enable: function() {

if ($.browser.msie && parseInt($.browser.version) < 8) {
$(function() {
// create hidden iframe for hash change tracking
iframe = $('<iframe id="ui-history-iframe" style="display: none;"></iframe>').
prependTo(document.body)[0];

// create initial history entry
iframe.contentWindow.document.open();
iframe.contentWindow.document.close();

if (getState())
states[getState()]();
else
// TODO invoke default
;
iframe.contentWindow.document.location.hash = getState();

});

if (!($.browser.msie && parseInt($.browser.version) >= 8)) {
setInterval(
($.browser.msie ?
function() {
if (hash != iframe.contentWindow.document.location.hash)
$window.trigger('hashchange');
} :
function() {
if (hash != location.hash)
$window.trigger('hashchange');
else
// Do the history.length check hack for Safari 2
;
}
)
, 200
);
}

$window.bind('hashchange', function(e) {
// Prevent IE 8 from fireing an event twice,
// one from true event, one from trigger...
if (!iframe && hash == location.hash || iframe && hash == iframe.contentWindow.document.location.hash)
return false;

if ($.browser.msie && parseInt($.browser.version) < 8) {
hash = iframe.contentWindow.document.location.hash;
}
else
hash = location.hash;

},

add: function(state, handler) {
states[state] = handler;
},
if (getState())
states[getState()]();
else
// TODO invoke default
;
});

go: function(state) {
if (state) {
if ($.browser.msie && parseInt($.browser.version) < 8) {
iframe.contentWindow.document.open();
iframe.contentWindow.document.close();
iframe.contentWindow.document.location.hash = state;
}
location.hash = state;
$window.trigger('hashchange');
}
else
console.log('TODO do default state');
if (!($.browser.msie && parseInt($.browser.version) >= 8)) {
setInterval(
($.browser.msie ?
function() {
if (hash != iframe.contentWindow.document.location.hash)
$window.trigger('hashchange');
} :
function() {
if (hash != location.hash)
$window.trigger('hashchange');
else
// Do the history.length check hack for Safari 2
;
}
)
, 200
);
}
},

}
add: function(state, handler) {
states[state] = handler;
},

};
go: function(state) {
if (state) {
if ($.browser.msie && parseInt($.browser.version) < 8) {
iframe.contentWindow.document.open();
iframe.contentWindow.document.close();
iframe.contentWindow.document.location.hash = state;
}
location.hash = state;
$window.trigger('hashchange');
}
else
console.log('TODO do default state');
}
}
};

$.ui.history = function() {
var args = Array.prototype.slice.call(arguments, 1);
$.ui.hmanager[arguments[0]].apply($.ui.hmanager, args);
};

$.ui.history = function() {
var args = Array.prototype.slice.call(arguments, 1);
$.ui.hmanager[arguments[0]].apply($.ui.hmanager, args);
};

})(jQuery);

0 comments on commit 12cdae0

Please sign in to comment.
You can’t perform that action at this time.