Overview

This report was build with JSLint, the JavaScript Verifier. JSLint is a JavaScript program that looks for problems in other JavaScript programs.

Here is the list of files in this report:

namespace-min.js

Lint at line 1 character 107: Missing semicolon.
jQuery.namespace=function(F,B){var C,A=F.split("."),E=window,D=false;if(/[^a-zA-Z.]/.test(F)){return false}for(C=0;C

namespace.js

No problems found

ajs.gadgets-min.js

Lint at line 1 character 356: Use '===' to compare with 'null'.
(function(){AJS.$.fn.serializeArray=function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();if(val==null){val="";}return val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();};AJS.$.extend({put:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return AJS.$.ajax({type:"PUT",url:url,data:data,success:callback,dataType:type});},del:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return AJS.$.ajax({type:"delete",url:url,data:data,success:callback,dataType:type});},ajax:function(ajax){var activeReq=0,dressResponse=function(xhr){var res={};res.rc=xhr.status;if(xhr.responseText!==""){res.data=gadgets.json.parse(xhr.responseText);}return res;};AJS.$.each("ajaxOpen,ajaxClosed,ajaxOauthApproval".split(","),function(i,o){AJS.$.fn[o]=function(f){return this.bind(o,f);};});AJS.$().ajaxSend(function(evt,req,options){if(++activeReq===1){AJS.$.event.trigger("ajaxOpen",[options]);}});AJS.$().ajaxComplete(function(evt,req,options){if(--activeReq===0){AJS.$.event.trigger("ajaxClosed",[options]);}});AJS.$.fn.ajaxComplete=function(f){f=function(actualF){return function(evt,response,options){if(response.status){actualF.call(this,evt,dressResponse(response),options);}else{actualF.apply(this,arguments);}};}(f);return this.bind("ajaxComplete",f);};AJS.$.fn.ajaxError=function(f){f=function(actualF){return function(evt,response,options){if(response.status){actualF.call(this,evt,dressResponse(response),options);}else{actualF.apply(this,arguments);}};}(f);return this.bind("ajaxError",f);};return function(usrOptions){var reqOptions={};if(typeof options==="string"){options={url:options};}var options=usrOptions;for(var name in AJS.$.ajaxSettings){if(!options[name]&&options[name]!==false){options[name]=AJS.$.ajaxSettings[name];}}if(options.baseUrl){if(!/^(http)|(https):\/\//.test(options.url)){options.url=options.baseUrl+options.url;}}if(typeof atlassian!=="undefined"&&atlassian.util){if(atlassian.util.getRendererBaseUrl()===options.baseUrl&&new RegExp(options.baseUrl).test(options.url)){if(options.error){options.error=function(error){return function(xhr,type){if(!xhr.responseText){options.success.apply(this,arguments);}else{error.call(this,dressResponse(xhr));}};}(options.error);}ajax.call(this,options);return;}}reqOptions[gadgets.io.RequestParameters.METHOD]=gadgets.io.MethodType[options.type.toUpperCase()];reqOptions[gadgets.io.RequestParameters.CONTENT_TYPE]=gadgets.io.ContentType[options.dataType.toUpperCase()];reqOptions.url=options.url;if(options.headers){reqOptions[gadgets.io.RequestParameters.HEADERS]=options.headers;}if(options.authorization){reqOptions[gadgets.io.RequestParameters.AUTHORIZATION]=gadgets.io.AuthorizationType[options.authorization.toUpperCase()];}if(options.useToken){reqOptions.OAUTH_USE_TOKEN=options.useToken;}if(options.summaries){reqOptions[gadgets.io.RequestParameters.GET_SUMMARIES]=options.summaries;}if(options.entries){reqOptions[gadgets.io.RequestParameters.NUM_ENTRIES]=options.entries;}if(options.data){if(options.type.toLowerCase()==="get"){if(typeof options.data==="string"){reqOptions.url+=("?"+options.data.replace(/^\?/,""));}else{reqOptions.url+=("?"+gadgets.io.encodeValues(options.data).replace(/^\?/,""));}}else{reqOptions[gadgets.io.RequestParameters.POST_DATA]=options.data;}}reqOptions.success=function(response){if(options.complete){options.complete(response,options);}if(options.global){AJS.$.event.trigger("ajaxComplete",[response,options]);}if(response.errors&&response.errors.length||response.oauthError){if(options.error){options.error(response,options);}if(options.global){AJS.$.event.trigger("ajaxError",[response,options]);}return;}if(options.dataType.toLowerCase()==="json"&&typeof response.data==="string"){if(options.error){options.error(response,options);}if(options.global){AJS.$.event.trigger("ajaxError",[response,options]);}return;}if(response.rc!==200){if(options.error){options.error(response,options);}if(options.global){AJS.$.event.trigger("ajaxError",[response,options]);}return;}if(options.success&&(response||response.oauthApprovalUrl)){options.success(response.data||response);}if(options.global){AJS.$.event.trigger("ajaxSuccess",[response.data,options]);}};gadgets.io.makeRequest(reqOptions.url,reqOptions.success,reqOptions);if(options.ajaxSend){options.ajaxSend(options);}if(options.global){AJS.$.event.trigger("ajaxSend",[options]);}};}(AJS.$.ajax)});AJS.$.namespace("AJS.gadgets.templater");AJS.gadgets.templater.Base=function(){var cache,template,descriptor=function(args){return args;},callbacks=[],remoteArgs=[],args=[],renderTemplate=function(){var cache={};return function(str,data){var fn;if(!/\W/.test(str)){fn=cache[str];}else{var fnString="var p=[], print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+str.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');";fn=new Function("obj",fnString);}return data?fn(data):fn;};}();return{getDescriptorData:function(callback){var argLengthComparator=0,that=this,formattedArgs={};if(remoteArgs.length<1){AJS.$(args).each(function(){formattedArgs[this.key]=this.data;});if(callback){callback.call(that,descriptor(formattedArgs));}else{return descriptor(formattedArgs);}}AJS.$(remoteArgs).each(function(i,item){var reqOptions;if(typeof item.ajaxOptions==="string"){reqOptions={url:this.ajaxOptions};}else{if(AJS.$.isFunction(item.ajaxOptions)){reqOptions=item.ajaxOptions();}else{reqOptions=item.ajaxOptions;}}reqOptions.success=function(response){++argLengthComparator;formattedArgs[remoteArgs[i].key]=response;if(argLengthComparator===remoteArgs.length){var excuter=function(){if(callback){callback.call(that,descriptor(formattedArgs));}else{return descriptor(formattedArgs);}return arguments.callee;}();if(cache!==false){that.getDescriptorData=excuter;}}};AJS.$.ajax(reqOptions);});},disableCache:function(){cache=false;},setTemplate:function(templ){template=templ;},setDescriptor:function(desc){descriptor=desc;},addCallback:function(func){callbacks.push(func);},setRemoteDescriptorArg:function(key,ajaxOptions){remoteArgs.push({key:key,ajaxOptions:ajaxOptions});},setDescriptorArg:function(arg){args.push(arg);},build:function(data){var that=this;if(!data&&data!==false){this.getDescriptorData(this.build);}else{if(data!==false){if(typeof template==="string"&&document.getElementById(template)){that.build.template=AJS.$(template).html();var fragment=renderTemplate(that.build.template,data);AJS.$(callbacks).each(function(){this.call(that,AJS.$(fragment),data);});}else{if(AJS.$.isFunction(template)){template(data);AJS.$(callbacks).each(function(){this.call(that,data);});}else{if(template.length>50){that.build.template=template;var fragment=renderTemplate(that.build.template,data);AJS.$(callbacks).each(function(){this.call(that,AJS.$(fragment),data);});}else{if(!that.build.template){AJS.$.ajax({url:template,dataType:"text",success:function(response){that.build.template=response;var fragment=renderTemplate(that.build.template,data);AJS.$(callbacks).each(function(){this.call(that,AJS.$(fragment),data);});}});}else{var fragment=renderTemplate(that.build.template,data);AJS.$(callbacks).each(function(){this.call(that,AJS.$(fragment),data);});}}}}}}}};};AJS.gadgets.templater.Custom=function(options){var templater=AJS.gadgets.templater.Base();templater.setTemplate(options.template);if(options.descriptor){templater.setDescriptor(options.descriptor);}if(options.callback){templater.addCallback(options.callback);}if(options.cache===false){templater.disableCache();}AJS.$.extend(templater,{getTarget:function(){return options.target;}});if(options.args){AJS.$(options.args).each(function(){if(this.ajaxOptions){templater.setRemoteDescriptorArg(this.key,this.ajaxOptions);}else{templater.setDescriptorArg(this);}});}return templater;};AJS.gadgets.templater.Form=function(options){return AJS.gadgets.templater.Custom(AJS.$.extend({template:AJS.gadgets.templater.Form.template,baseUrl:AJS.gadget.getBaseUrl(),callback:function(response,data){if(options.target){options.target.html(response);if(options.submit){AJS.$("form",options.target).submit(options.submit);}if(options.cancel){AJS.$("input.cancel",options.target).click(options.cancel);}AJS.$(data.fields).each(function(){if(this.type==="callbackBuilder"){var targetDiv=AJS.$("div#"+this.id);this.callback(targetDiv);}});}else{return response;}}},options));};AJS.gadgets.templater.Table=function(options){var table,sortCol,sortOrd=[],sort=function(data,column,order){data.cols[column].theme=order;if(!data.cols[column].sorted){data.data.sort(function(item,compareItem){var dataItem=item[column].value,dataItemCompare=compareItem[column].value;if(!isNaN(parseFloat(dataItem))&&!isNaN(parseFloat(dataItemCompare))){dataItem=parseFloat(dataItem);dataItemCompare=parseFloat(dataItemCompare);}if(dataItem>dataItemCompare){return 1;}else{if(dataItem" method="post" class="aui <%= gadgets.util.escape(obj.theme || \'\') %>">    <% if (obj.title) { %>        

<%= gadgets.util.escape(obj.title) %>

<% } %><% if (obj.description ) { %>

<%= gadgets.util.escape(obj.description) %>

<% } %><% if (obj.fieldsets) { %><% for ( var i = 0; i < obj.fieldsets.length; i++ ) { %><% createFieldset(obj.fieldsets[i], obj.type); %><% } %><% } else if (obj.fields && obj.fields.length > 0) { %><% for ( var i = 0; i < obj.fields.length; i++ ) { %><% createField(obj.fields[i], obj.theme); %><% } %><% } %>
';AJS.gadgets.templater.Table.template=' <% if (obj.cols) { %> <% AJS.$(obj.cols).each(function () { %> <% }); %> <% } %> <% if (obj.data) { %> <% AJS.$(obj.data).each(function (i) { %> class="even" <% } %> > <% AJS.$(this).each(function () { %> <% }); %> <% }); %> <% } %>
class="<%= this.theme %>" <% } %> >
<%= this.header %>
<%= this.label %>
';AJS.$.namespace("AJS.gadget");if(!console.warn){console.warn=function(){};}var Gadget=function(options){AJS.dropDown.Standard=function(dropDown){function canBeMovedToParentFrame(){return !AJS.$.browser.msie&&!AJS.$.browser.opera&&window.top.AJS;}function overflowsIframeHeight(){return parseInt(AJS.$("body").attr("scrollHeight"))>AJS.$("body").outerHeight();}function hideActiveDropdowns(e){if(AJS.$(e.target).parents(".aui-dropdown").length===0){window.top.AJS.$(window.top.document).trigger("click");AJS.$(document).trigger("click");}}function adjustDDPositioning(){if(AJS.dropDown.current&&AJS.dropDown.current.calculateDDPosition){AJS.dropDown.current.updateDDPosition();}}function parentAsContainerHandler(){var top;if(overflowsIframeHeight()){this.updateDDPosition();this.$.remove().addClass("gadget-dropdown");this.shadow.remove();this.shadow.appendTo(window.top.document.body);this.$.appendTo(window.top.document.body);arguments.callee=function(){this.$.css("top",top);this.shadow.css("top",top);};}}var iframeAsContainerHandler={show:function(){if(overflowsIframeHeight()&&gadgets.window.adjustHeight){iframeAsContainerHandler.restoreHeight=AJS.$("body").outerHeight();gadgets.window.adjustHeight(AJS.$("body").attr("scrollHeight"));}},hide:function(){if(iframeAsContainerHandler.restoreHeight){gadgets.window.adjustHeight(iframeAsContainerHandler.restoreHeight);iframeAsContainerHandler.restoreHeight=undefined;}}};if(window.top.AJS){AJS.$(".dd-allocated, body").live("mousedown",hideActiveDropdowns);window.top.AJS.$(".dd-allocated, body").live("mousedown",hideActiveDropdowns);}AJS.$(window).resize(adjustDDPositioning);return function(options){var dropdowns;options.selectionHandler=options.selectionHandler||function(e,item){if(item[0].nodeName==="A"){window.top.location.href=item.attr("href");}else{window.top.location.href=AJS.$("a",item).attr("href");}};dropdowns=dropDown.call(this,options);AJS.$.each(dropdowns,function(){if(canBeMovedToParentFrame()){this.updateDDPosition=function(){var dropdownOffsets;function getLeftInPercent(left){return left/window.top.AJS.$("body").width()*100+"%";}function calculateOffsets(){var dropdownOffset=this.trigger.offset(),iframeOffset=window.top.AJS.$("#"+window.name).offset();return{top:dropdownOffset.top+this.trigger.outerHeight()+iframeOffset.top,left:dropdownOffset.left+iframeOffset.left+this.trigger.outerWidth()-this.$.outerWidth(),width:this.$.outerWidth()};}if(!this.trigger.is(":visible")){this.hide();}else{dropdownOffsets=calculateOffsets.call(this);this.$.css({top:dropdownOffsets.top,margin:0,left:getLeftInPercent(dropdownOffsets.left),right:"auto"});this.shadow.css({left:getLeftInPercent(dropdownOffsets.left-7),top:dropdownOffsets.top,right:"auto"});}};this.addCallback("show",parentAsContainerHandler);}else{this.addCallback("show",iframeAsContainerHandler.show);this.addCallback("hide",iframeAsContainerHandler.hide);}});return dropdowns;};}(AJS.dropDown.Standard);var prefs=new gadgets.Prefs(),viewMode,message=function(){var popup;return{show:function(msg,classNm,dismissible){var messageEl,buttons,cancelButton,buttonPanel,targHeight;messageEl=AJS.$("
").addClass(classNm).css({width:260,visiblity:"hidden"}).html(msg).appendTo("body");buttons=AJS.$("button",messageEl);if(dismissible!==false){cancelButton=AJS.$("

ajs-gadgets.js

Lint at line 146 character 41: Missing space after 'function'.
AJS.gadgets.oauth.makeRequest = function(url, params) {

Lint at line 147 character 29: Missing space after 'function'.
var doNothing = function() {};

Lint at line 148 character 38: Missing space after 'function'.
var showOAuthPopupLink = function(approvalUrl) {

Lint at line 176 character 45: Missing space after 'function'.
var showOAuthApprovalDoneLink = function() {

Lint at line 180 character 37: Missing space after 'function'.
var hideApprovalLinks = function() {

Lint at line 187 character 6: Bad line breaking before '&&'.
&& gParams[gadgets.io.RequestParameters.AUTHORIZATION] != gadgets.io.AuthorizationType.OAUTH) {

Lint at line 187 character 61: Expected '!==' and instead saw '!='.
&& gParams[gadgets.io.RequestParameters.AUTHORIZATION] != gadgets.io.AuthorizationType.OAUTH) {

Lint at line 196 character 31: Missing space after 'function'.
var makeRequest = function() {

Lint at line 212 character 58: Missing space after 'function'.
params.onPopupClose = params.onPopupClose || function() {

Lint at line 215 character 6: Missing semicolon.
}

ajs.gadgets.js

Lint at line 62 character 17: Use '===' to compare with 'null'.
if (val == null) {

Lint at line 180 character 25: 'options' was used before it was defined.
var options = usrOptions;

Lint at line 234 character 28: ['OAUTH_USE_TOKEN'] is better written in dot notation.
reqOptions["OAUTH_USE_TOKEN"] = options.useToken;

Lint at line 420 character 21: Bad line breaking before '+'.
+ "');}return p.join('');";

Lint at line 422 character 34: The Function constructor is eval.
fn = new Function("obj", fnString);

Lint at line 581 character 34: 'fragment' is already defined.
var fragment = renderTemplate(that.build.template, data);

Lint at line 599 character 38: 'fragment' is already defined.
var fragment = renderTemplate(that.build.template, data);

Lint at line 818 character 20: Missing radix parameter.
return parseInt(AJS.$("body").attr("scrollHeight")) > AJS.$("body").outerHeight();

Lint at line 843 character 34: Bad assignment.
arguments.callee = function () {

Lint at line 849 character 10: Unnecessary semicolon.
};

Lint at line 1042 character 18: Expected '{' and instead saw 'var'.
else var expires = "";

Lint at line 1042 character 30: 'expires' is already defined.
else var expires = "";

Lint at line 1059 character 42: Expected '{' and instead saw 'c'.
while (c.charAt(0)==' ') c = c.substring(1,c.length);

Lint at line 1060 character 39: Use '===' to compare with '0'.
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);

Lint at line 1060 character 45: Expected '{' and instead saw 'return'.
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);

Lint at line 1418 character 30: Unnecessary semicolon.
};

Lint at line 2078 character 33: The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.
for (var name in fieldValues) {