Permalink
Browse files

update jshint for unused:true

  • Loading branch information...
1 parent 7c69120 commit 7de2bdeeabed4a4b534dd21a3191cf43a2568835 Ian Maffett committed Apr 7, 2014
View
@@ -23,7 +23,7 @@
"af":false
},
- "unused": false,
+ "unused": true,
"browser": true,
"strict": true,
"trailing": true,
View
@@ -4,11 +4,10 @@
* @author Ian Maffett
* @description A plugin to allow jQuery developers to use App Framework UI
*/
-/* global jquery*/
/* jshint eqeqeq:false */
(function($,window){
"use strict";
- var nundefined, document = window.document,classCache = {},isWin8=(typeof(MSApp)==="object"),jsonPHandlers = [],_jsonPID = 1;
+ var nundefined, document = window.document,classCache = {},isWin8=(typeof(MSApp)==="object"),_jsonPID = 1;
function classRE(name) {
return name in classCache ? classCache[name] : (classCache[name] = new RegExp("(^|\\s)" + name + "(\\s|$)"));
@@ -375,7 +374,6 @@
$.is$ = function (obj) {
return obj instanceof $;
};
- var empty=function(){};
$.jsonP = function(options) {
if (isWin8) {
options.type = "get";
@@ -386,11 +384,6 @@
var abortTimeout = "",
context, callback;
var script = document.createElement("script");
- var abort = function() {
- $(script).remove();
- if (window[callbackName])
- window[callbackName] = empty;
- };
window[callbackName] = function(data) {
clearTimeout(abortTimeout);
$(script).remove();
View
@@ -4,7 +4,6 @@
* Modifications/enhancements by Intel for App Framework
*
*/
-
/* EXAMPLE
$.query("body").popup({
title:"Alert! Alert!",
@@ -58,7 +58,7 @@
$.unbind($.touchLayer,"scrollstart",trackScroll);
};
- var initScrollStart = function(el,pos){
+ var initScrollStart = function(){
startY=null;
prevY=0;
};
@@ -64,7 +64,6 @@
el.watch("selectedIndex", updateIndex);
for (var j = 0; j < el.options.length; j++) {
- var currInd = j;
el.options[j].watch("selected", updateOption);
if (el.options[j].selected)
fixer.html(el.options[j].text);
@@ -82,16 +81,13 @@
},
initDropDown: function(el) {
- var that = this;
if (el.disabled) return;
if (!el || !el.options || el.options.length === 0) return;
- var htmlTemplate = "";
var foundInd = 0;
var $scr = $("#afSelectBoxfix");
$scr.html("<ul></ul>");
var $list = $scr.find("ul");
for (var j = 0; j < el.options.length; j++) {
- var currInd = j;
el.options[j].watch("selected", updateOption);
var checked = (el.options[j].selected) ? "selected" : "";
if (checked) foundInd = j + 1;
@@ -167,7 +163,7 @@
return;
}
$(document).ready(function() {
- $(document).on("click", ".afFakeSelect", function(e) {
+ $(document).on("click", ".afFakeSelect", function() {
if (this.linker.disabled)
return;
that.currLinker = this;
@@ -227,7 +223,7 @@
var $sel = $(that.currLinker.linker);
$sel.find("option").prop("selected", false);
- $("#afSelectBoxfix li").each(function(el) {
+ $("#afSelectBoxfix li").each(function() {
var $el = $(this);
if ($el.hasClass("selected")) {
var ind = parseInt($el.data("ind"), 10);
@@ -85,7 +85,7 @@
if($.ui.splitview&&window.innerWidth>=parseInt($.ui.handheldMinWidth,10)&& (dx > startX)&&openState===0) return true;
if (!$.ui.isSideMenuEnabled() && (dx > startX) && openState===0) return true;
- if (!$.ui.isAsideMenuEnabled() && (dx < startX) && openState===0) return true;
+ if (!$.ui.isAsideMenuEnabled() && (dx < startX) && openState===0) return true;
if (Math.abs(dy - startY) > Math.abs(dx - startX)) return true;
if (!checking) {
@@ -109,7 +109,7 @@
}
}
- if (Math.abs(thePlace) > max){
+ if (Math.abs(thePlace) > max){
return true;
}
@@ -148,7 +148,7 @@
},true);
- afui.addEventListener("touchend", function(e) {
+ afui.addEventListener("touchend", function() {
if (!$.ui.isSideMenuEnabled() && !$.ui.isAsideMenuEnabled()) return true;
if (doMenu && checking&&!keepOpen) {
$.ui.toggleSideMenu(showHideThresh, function(){
@@ -42,11 +42,6 @@
var skipTouchEnd = false; //Fix iOS bug with alerts/confirms
var cancelClick = false;
- function getTime() {
- var d = new Date();
- var n = d.getTime();
- return n;
- }
var touchLayer = function(el) {
this.clearTouchVars();
el.addEventListener("touchstart", this, false);
@@ -91,7 +86,7 @@
that.isScrolling = true;
that.scrollingEl_ = el;
if (!$.feat.nativeTouchScroll)
- that.scrollerIsScrolling = true;
+ that.scrollerIsScrolling = true;
that.fireEvent("UIEvents", "scrollstart", el, false, false);
});
$.bind(this, "scrollend", function(el) {
@@ -235,7 +230,7 @@
} else
return numOnly(document.documentElement.style.height); //TODO: works well on iPhone, test BB
},
- onOrientationChange: function(e) {
+ onOrientationChange: function() {
//this.log("orientationchange");
//if a resize already happened, fire the orientationchange
var self=this;
@@ -255,7 +250,7 @@
}, time);
}
},
- onResize: function(e) {
+ onResize: function() {
//avoid infinite loop on iPhone
if (this.ignoreNextResize_) {
//this.log("ignored resize");
View
@@ -12,7 +12,6 @@
(function($) {
"use strict";
- var hasLaunched = false;
var startPath = window.location.pathname + window.location.search;
var defaultHash = window.location.hash;
var previousTarget = defaultHash;
@@ -239,7 +238,7 @@
```
@title $.ui.enableTabBar
*/
- enableTabBar:function(e){
+ enableTabBar:function(){
$(document).on("click",".button-grouped.tabbed",function(e){
var $el=$(e.target);
$el.closest(".tabbed").find(".button").data("ignore-pressed","true").removeClass("pressed");
@@ -257,7 +256,7 @@
```
* @title $.ui.disableTabBar
*/
- disableTabBar:function(e){
+ disableTabBar:function(){
$(document).off("click",".button-grouped.tabbed");
$(".button-grouped.tabbed .button").removeAttr("data-ignore-pressed");
},
@@ -476,7 +475,7 @@
if (this.launchCompleted)
param();
else {
- $(document).on("afui:ready", function(e) {
+ $(document).on("afui:ready", function() {
param();
});
}
@@ -774,7 +773,6 @@
this.disableLeftSideMenu();
},
disableLeftSideMenu:function(){
- var that = this;
var els = $.query("#content, #header, #navbar");
if (this.isSideMenuOn()) {
this.toggleSideMenu(false, function(canceled) {
@@ -804,7 +802,6 @@
* @title $.ui.disableSideMenu();
*/
disableRightSideMenu:function(){
- var that = this;
var els = $.query("#content, #header, #navbar");
if (this.isSideMenuOn()) {
this.toggleSideMenu(false, function(canceled) {
@@ -999,7 +996,6 @@
return this.updateRightSideMenuElements.apply(this,arguments);
},
updateRightSideMenuElements:function(elems){
- var that = this;
if (elems === undefined || elems === null) return;
var nb = $.query("#aside_menu_scroller");
@@ -1036,7 +1032,6 @@
return this.updateLeftSideMenuElements.apply(this,arguments);
},
updateLeftSideMenuElements:function(elems) {
- var that = this;
if (elems === undefined || elems === null) return;
var nb = $.query("#menu_scroller");
@@ -1589,14 +1584,12 @@
loadContent: function(target, newTab, back, transition, anchor) {
if (this.doingTransition) {
- var that = this;
this.loadContentQueue.push([target, newTab, back, transition, anchor]);
return;
}
if (target.length === 0) return;
- var what = null;
var loadAjax = true;
anchor = anchor || document.createElement("a"); //Hack to allow passing in no anchor
if (target.indexOf("#") === -1) {
@@ -1718,11 +1711,10 @@
* @param {string} target
* @param {boolean=} newtab (resets history)
* @param {boolean=} go back (initiate the back click)
- * @param {string=} transition
- * @title $.ui.loadDiv(target,newTab,goBack,transition);
+ * @title $.ui.loadContentData(target,newTab,goBack);
* @api private
*/
- loadContentData: function(what, newTab, back, transition) {
+ loadContentData: function(what, newTab, back) {
var prevId, el, val, slashIndex;
if (back) {
if (this.history.length > 0) {
@@ -2052,7 +2044,6 @@
for (var i = 0; i < contentDivs.length; i++) {
var el = contentDivs[i];
var tmp = el;
- var id = el.id;
var prevSibling = el.previousSibling;
if (el.parentNode && el.parentNode.id !== "content") {
if (tmp.getAttribute("selected")) this.firstDiv = el;
@@ -2088,7 +2079,7 @@
$(document).trigger("defer:loaded");
}
},
- error: function(msg) {
+ error: function() {
//still trigger the file as being loaded to not block $.ui.ready
console.log("Error with deferred load " + intel.xdk.webRoot + defer[j]);
loaded++;
@@ -2242,7 +2233,7 @@
/**
* This is the default transition. It simply shows the new panel and hides the old
*/
- noTransition: function(oldDiv, currDiv, back) {
+ noTransition: function(oldDiv, currDiv) {
currDiv.style.display = "block";
oldDiv.style.display = "block";
var that = this;
@@ -2385,7 +2376,7 @@
});
//Fix an ios bug where scrolling will not work with rotation
if ($.feat.nativeTouchScroll) {
- document.addEventListener("orientationchange", function(e) {
+ document.addEventListener("orientationchange", function() {
if ($.ui.scrollingDivs[$.ui.activeDiv.id]) {
var tmpscroller = $.ui.scrollingDivs[$.ui.activeDiv.id];
if(!tmpscroller) return;

0 comments on commit 7de2bde

Please sign in to comment.