removed dead code

This commit is contained in:
Luke Pulverenti 2015-11-27 11:21:45 -05:00
parent 776f430ef7
commit 316fce063a
7 changed files with 314 additions and 938 deletions

View File

@ -209,7 +209,6 @@
}
bindEvents(elem);
$.mobile.loadPage('nowplaying.html');
return elem;
}

View File

@ -48,6 +48,26 @@
(function ($, undefined) {
function keepNativeSelector() {
var keepNative = $.trim("[data-role='none']"),
globalValue = $.trim($.mobile.keepNative),
optionValue = $.trim("[data-role='none']"),
// Check if $.mobile.keepNative has changed from the factory default
newDefault = "",
// If $.mobile.keepNative has not changed, use options.keepNativeDefault
oldDefault = (newDefault === "" ? optionValue : "");
// Concatenate keepNative selectors from all sources where the value has
// changed or, if nothing has changed, return the default
return ((keepNative ? [keepNative] : [])
.concat(newDefault ? [newDefault] : [])
.concat(oldDefault ? [oldDefault] : [])
.join(", "));
}
$.widget("mobile.controlgroup", $.extend({
options: {
enhanced: false,
@ -62,7 +82,7 @@
_create: function () {
var elem = this.element,
opts = this.options,
keepNative = $.mobile.page.prototype.keepNativeSelector();
keepNative = keepNativeSelector();
// Run buttonmarkup
if ($.fn.buttonMarkup) {

View File

@ -181,7 +181,7 @@
altButtonClass = "ui-btn ui-btn-icon-notext ui-icon-" + spliticon + splitThemeClass;
last
.attr("title", $.trim(last.getEncodedText()))
.attr("title", $.trim(last.text()))
.addClass(altButtonClass)
.empty();

View File

@ -1,4 +1,84 @@
(function ($, undefined) {
var props = {
"animation": {},
"transition": {}
},
testElement = document.createElement("a"),
vendorPrefixes = ["", "webkit-", "moz-", "o-"];
$.each(["animation", "transition"], function (i, test) {
// Get correct name for test
var testName = (i === 0) ? test + "-" + "name" : test;
$.each(vendorPrefixes, function (j, prefix) {
if (testElement.style[$.camelCase(prefix + testName)] !== undefined) {
props[test]["prefix"] = prefix;
return false;
}
});
// Set event and duration names for later use
props[test]["duration"] =
$.camelCase(props[test]["prefix"] + test + "-" + "duration");
props[test]["event"] =
$.camelCase(props[test]["prefix"] + test + "-" + "end");
// All lower case if not a vendor prop
if (props[test]["prefix"] === "") {
props[test]["event"] = props[test]["event"].toLowerCase();
}
});
// Remove the testElement
$(testElement).remove();
// Animation complete callback
$.fn.animationComplete = function (callback, type, fallbackTime) {
var timer, duration,
that = this,
eventBinding = function () {
// Clear the timer so we don't call callback twice
clearTimeout(timer);
callback.apply(this, arguments);
},
animationType = (!type || type === "animation") ? "animation" : "transition";
// If a fallback time was not passed set one
if (fallbackTime === undefined) {
// Make sure the was not bound to document before checking .css
if ($(this).context !== document) {
// Parse the durration since its in second multiple by 1000 for milliseconds
// Multiply by 3 to make sure we give the animation plenty of time.
duration = parseFloat(
$(this).css(props[animationType].duration)
) * 3000;
}
// If we could not read a duration use the default
if (duration === 0 || duration === undefined || isNaN(duration)) {
duration = $.fn.animationComplete.defaultDuration;
}
}
// Sets up the fallback if event never comes
timer = setTimeout(function () {
$(that).off(props[animationType].event, eventBinding);
callback.apply(that);
}, duration);
// Bind the event
return $(this).one(props[animationType].event, eventBinding);
};
// Allow default callback to be configured on mobileInit
$.fn.animationComplete.defaultDuration = 1000;
})(jQuery);
(function ($, undefined) {
$.widget("mobile.panel", {
options: {
@ -48,7 +128,7 @@
this._addPanelClasses();
// if animating, add the class to do so
if ($.support.cssTransform3d && !!this.options.animate) {
if (!!this.options.animate) {
this.element.addClass(this.options.classes.animate);
}
@ -136,12 +216,11 @@
_positionPanel: function (scrollToTop) {
var self = this,
panelInnerHeight = self._panelInner.outerHeight(),
expand = panelInnerHeight > $.mobile.getScreenHeight();
expand = panelInnerHeight > (window.innerHeight || $(window).height());
if (expand || !self.options.positionFixed) {
if (expand) {
self._unfixPanel();
$.mobile.resetActivePageHeight(panelInnerHeight);
}
if (scrollToTop) {
this.window[0].scrollTo(0, $.mobile.defaultHomeScroll);
@ -278,11 +357,11 @@
self._off(self.document, "panelclose");
self._page().jqmData("panel", "open");
if ($.support.cssTransform3d && !!o.animate && o.display !== "overlay") {
if (!!o.animate && o.display !== "overlay") {
self._wrapper.addClass(o.classes.animate);
}
if (!immediate && $.support.cssTransform3d && !!o.animate) {
if (!immediate && !!o.animate) {
(self._wrapper || self.element)
.animationComplete(complete, "transition");
} else {
@ -359,7 +438,7 @@
self._wrapper.removeClass(self._pageContentOpenClasses);
}
if (!immediate && $.support.cssTransform3d && !!o.animate) {
if (!immediate && !!o.animate) {
(self._wrapper || self.element)
.animationComplete(complete, "transition");
} else {
@ -384,13 +463,12 @@
self._wrapper.removeClass(o.classes.pageContentPrefix + "-open");
}
if ($.support.cssTransform3d && !!o.animate && o.display !== "overlay") {
if (!!o.animate && o.display !== "overlay") {
self._wrapper.removeClass(o.classes.animate);
}
self._fixPanel();
self._unbindFixListener();
$.mobile.resetActivePageHeight();
self._page().jqmRemoveData("panel");

View File

@ -1,4 +1,84 @@
(function ($, undefined) {
var props = {
"animation": {},
"transition": {}
},
testElement = document.createElement("a"),
vendorPrefixes = ["", "webkit-", "moz-", "o-"];
$.each(["animation", "transition"], function (i, test) {
// Get correct name for test
var testName = (i === 0) ? test + "-" + "name" : test;
$.each(vendorPrefixes, function (j, prefix) {
if (testElement.style[$.camelCase(prefix + testName)] !== undefined) {
props[test]["prefix"] = prefix;
return false;
}
});
// Set event and duration names for later use
props[test]["duration"] =
$.camelCase(props[test]["prefix"] + test + "-" + "duration");
props[test]["event"] =
$.camelCase(props[test]["prefix"] + test + "-" + "end");
// All lower case if not a vendor prop
if (props[test]["prefix"] === "") {
props[test]["event"] = props[test]["event"].toLowerCase();
}
});
// Remove the testElement
$(testElement).remove();
// Animation complete callback
$.fn.animationComplete = function (callback, type, fallbackTime) {
var timer, duration,
that = this,
eventBinding = function () {
// Clear the timer so we don't call callback twice
clearTimeout(timer);
callback.apply(this, arguments);
},
animationType = (!type || type === "animation") ? "animation" : "transition";
// If a fallback time was not passed set one
if (fallbackTime === undefined) {
// Make sure the was not bound to document before checking .css
if ($(this).context !== document) {
// Parse the durration since its in second multiple by 1000 for milliseconds
// Multiply by 3 to make sure we give the animation plenty of time.
duration = parseFloat(
$(this).css(props[animationType].duration)
) * 3000;
}
// If we could not read a duration use the default
if (duration === 0 || duration === undefined || isNaN(duration)) {
duration = $.fn.animationComplete.defaultDuration;
}
}
// Sets up the fallback if event never comes
timer = setTimeout(function () {
$(that).off(props[animationType].event, eventBinding);
callback.apply(that);
}, duration);
// Bind the event
return $(this).one(props[animationType].event, eventBinding);
};
// Allow default callback to be configured on mobileInit
$.fn.animationComplete.defaultDuration = 1000;
})(jQuery);
(function ($, undefined) {
function fitSegmentInsideSegment(windowSize, segmentSize, offset, desired) {
var returnValue = desired;
@ -23,6 +103,21 @@
};
}
// non-UA-based IE version check by James Padolsey, modified by jdalton - from http://gist.github.com/527683
// allows for inclusion of IE 6+, including Windows Mobile 7
$.extend($.mobile, { browser: {} });
$.mobile.browser.oldIE = (function () {
var v = 3,
div = document.createElement("div"),
a = div.all || [];
do {
div.innerHTML = "<!--[if gt IE " + (++v) + "]><br><![endif]-->";
} while (a[0]);
return v > 4 ? v : !v;
})();
$.widget("mobile.popup", {
options: {
wrapperClass: null,
@ -107,8 +202,7 @@
this._on(this._ui.screen, { "click": "_eatEventAndClose" });
this._on(this.window, {
orientationchange: $.proxy(this, "_handleWindowOrientationchange"),
resize: $.proxy(this, "_handleWindowResize"),
keyup: $.proxy(this, "_handleWindowKeyUp")
resize: $.proxy(this, "_handleWindowResize")
});
this._on(this.document, { "focusin": "_handleDocumentFocusIn" });
},
@ -187,12 +281,6 @@
}
},
_handleWindowKeyUp: function (theEvent) {
if (this._isOpen && theEvent.keyCode === $.mobile.keyCode.ESCAPE) {
return this._eatEventAndClose(theEvent);
}
},
_expectResizeEvent: function () {
var windowCoordinates = getWindowCoordinates(this.window);
@ -917,7 +1005,7 @@
this._scrollTop = this.window.scrollTop();
if (this.options.history && this.urlAltered) {
$.mobile.back();
$.mobile.pageContainer.pagecontainer("back");
this.urlAltered = false;
} else {
// simulate the nav bindings having fired

View File

@ -1,5 +1,48 @@
(function ($, undefined) {
/*!
* jQuery UI Core c0ab71056b936627e8a7821f03c044aec6280a40
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/category/ui-core/
*/
(function ($, undefined) {
// $.ui might exist from components with no dependencies, e.g., $.ui.position
$.ui = $.ui || {};
$.extend($.ui, {
version: "c0ab71056b936627e8a7821f03c044aec6280a40",
keyCode: {
BACKSPACE: 8,
COMMA: 188,
DELETE: 46,
DOWN: 40,
END: 35,
ENTER: 13,
ESCAPE: 27,
HOME: 36,
LEFT: 37,
PAGE_DOWN: 34,
PAGE_UP: 33,
PERIOD: 190,
RIGHT: 39,
SPACE: 32,
TAB: 9,
UP: 38
}
});
// deprecated
$.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());
})(jQuery);
$.widget("mobile.slider", $.extend({
initSelector: "input[type='range']:not([data-role='none'])",
@ -230,14 +273,14 @@
// In all cases prevent the default and mark the handle as active
switch (event.keyCode) {
case $.mobile.keyCode.HOME:
case $.mobile.keyCode.END:
case $.mobile.keyCode.PAGE_UP:
case $.mobile.keyCode.PAGE_DOWN:
case $.mobile.keyCode.UP:
case $.mobile.keyCode.RIGHT:
case $.mobile.keyCode.DOWN:
case $.mobile.keyCode.LEFT:
case $.ui.keyCode.HOME:
case $.ui.keyCode.END:
case $.ui.keyCode.PAGE_UP:
case $.ui.keyCode.PAGE_DOWN:
case $.ui.keyCode.UP:
case $.ui.keyCode.RIGHT:
case $.ui.keyCode.DOWN:
case $.ui.keyCode.LEFT:
event.preventDefault();
if (!this._keySliding) {
@ -250,20 +293,20 @@
// move the slider according to the keypress
switch (event.keyCode) {
case $.mobile.keyCode.HOME:
case $.ui.keyCode.HOME:
this.refresh(this.min);
break;
case $.mobile.keyCode.END:
case $.ui.keyCode.END:
this.refresh(this.max);
break;
case $.mobile.keyCode.PAGE_UP:
case $.mobile.keyCode.UP:
case $.mobile.keyCode.RIGHT:
case $.ui.keyCode.PAGE_UP:
case $.ui.keyCode.UP:
case $.ui.keyCode.RIGHT:
this.refresh(index + this.step);
break;
case $.mobile.keyCode.PAGE_DOWN:
case $.mobile.keyCode.DOWN:
case $.mobile.keyCode.LEFT:
case $.ui.keyCode.PAGE_DOWN:
case $.ui.keyCode.DOWN:
case $.ui.keyCode.LEFT:
this.refresh(index - this.step);
break;
}
@ -475,9 +518,9 @@
this.handle[0].setAttribute("aria-valuenow", isInput ? newval : optionElements.eq(newval).attr("value"));
this.handle[0].setAttribute("aria-valuetext", isInput ? newval : optionElements.eq(newval).getEncodedText());
this.handle[0].setAttribute("aria-valuetext", isInput ? newval : optionElements.eq(newval).text());
this.handle[0].setAttribute("title", isInput ? newval : optionElements.eq(newval).getEncodedText());
this.handle[0].setAttribute("title", isInput ? newval : optionElements.eq(newval).text());
if (this.valuebg) {
this.valuebg.css("width", percent + "%");

File diff suppressed because it is too large Load Diff