Author: lindner
Date: Thu Jan 22 17:59:50 2009
New Revision: 736888
URL: http://svn.apache.org/viewvc?rev=736888&view=rev
Log:
SHINDIG-776 | Adapted patch from Henning Schmiedehausen | jslint issues -
coercions except for opensocial-templates
Modified:
incubator/shindig/trunk/features/core.io/io.js
incubator/shindig/trunk/features/opensocial-jsonrpc/jsonrpccontainer.js
incubator/shindig/trunk/features/opensocial-rest/restfulcontainer.js
incubator/shindig/trunk/features/tabs/tabs.js
incubator/shindig/trunk/javascript/container/cookies.js
incubator/shindig/trunk/javascript/container/gadgets.js
incubator/shindig/trunk/site/index.html
Modified: incubator/shindig/trunk/features/core.io/io.js
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/features/core.io/io.js?rev=736888&r1=736887&r2=736888&view=diff
==============================================================================
--- incubator/shindig/trunk/features/core.io/io.js (original)
+++ incubator/shindig/trunk/features/core.io/io.js Thu Jan 22 17:59:50 2009
@@ -201,7 +201,7 @@
xhr.onreadystatechange = gadgets.util.makeClosure(
null, processResponseFunction, realUrl, callback, params, xhr);
}
- if (paramData != null) {
+ if (paramData !== null) {
xhr.setRequestHeader('Content-Type', opt_contentType ||
'application/x-www-form-urlencoded');
xhr.send(paramData);
} else {
Modified:
incubator/shindig/trunk/features/opensocial-jsonrpc/jsonrpccontainer.js
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/features/opensocial-jsonrpc/jsonrpccontainer.js?rev=736888&r1=736887&r2=736888&view=diff
==============================================================================
--- incubator/shindig/trunk/features/opensocial-jsonrpc/jsonrpccontainer.js
(original)
+++ incubator/shindig/trunk/features/opensocial-jsonrpc/jsonrpccontainer.js Thu
Jan 22 17:59:50 2009
@@ -60,7 +60,7 @@
var body = gadgets.util.unescapeString(reason.getField(
opensocial.Message.Field.BODY));
- if (!body || body.length == 0) {
+ if (!body || body.length === 0) {
var bodyMsgKey = gadgets.util.unescapeString(reason.getField(
opensocial.Message.Field.BODY_ID));
body = gadgets.Prefs.getMsg(bodyMsgKey);
@@ -118,7 +118,7 @@
var requestObjects = dataRequest.getRequestObjects();
var totalRequests = requestObjects.length;
- if (totalRequests == 0) {
+ if (totalRequests === 0) {
window.setTimeout(function() {
callback(new opensocial.DataResponse({}, true));
}, 0);
@@ -337,7 +337,7 @@
};
JsonRpcContainer.prototype.hasNoKeys = function(keys) {
- return !keys || keys.length == 0;
+ return !keys || keys.length === 0;
};
JsonRpcContainer.prototype.isWildcardKey = function(key) {
Modified: incubator/shindig/trunk/features/opensocial-rest/restfulcontainer.js
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/features/opensocial-rest/restfulcontainer.js?rev=736888&r1=736887&r2=736888&view=diff
==============================================================================
--- incubator/shindig/trunk/features/opensocial-rest/restfulcontainer.js
(original)
+++ incubator/shindig/trunk/features/opensocial-rest/restfulcontainer.js Thu
Jan 22 17:59:50 2009
@@ -65,7 +65,7 @@
var requestObjects = dataRequest.getRequestObjects();
var totalRequests = requestObjects.length;
- if (totalRequests == 0) {
+ if (totalRequests === 0) {
window.setTimeout(function () {
callback(new opensocial.DataResponse({}, true));
}, 0);
@@ -262,7 +262,7 @@
};
RestfulContainer.prototype.hasNoKeys = function(keys) {
- return !keys || keys.length == 0;
+ return !keys || keys.length === 0;
};
RestfulContainer.prototype.isWildcardKey = function(key) {
Modified: incubator/shindig/trunk/features/tabs/tabs.js
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/features/tabs/tabs.js?rev=736888&r1=736887&r2=736888&view=diff
==============================================================================
--- incubator/shindig/trunk/features/tabs/tabs.js (original)
+++ incubator/shindig/trunk/features/tabs/tabs.js Thu Jan 22 17:59:50 2009
@@ -229,7 +229,7 @@
}
if (tabName == this.defaultTabName_ || (!this.defaultTabName_
- && tabIndex == 0)) {
+ && tabIndex === 0)) {
this.selectTab_(tab);
}
@@ -263,7 +263,7 @@
this.mainContainer_.removeChild(tab.contentContainer_);
this.tabs_.splice(tabIndex, 1);
this.adjustNavigation_();
- if (this.tabs_.length == 0) {
+ if (this.tabs_.length === 0) {
this.displayTabs(false);
this.selectedTab_ = null;
}
Modified: incubator/shindig/trunk/javascript/container/cookies.js
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/javascript/container/cookies.js?rev=736888&r1=736887&r2=736888&view=diff
==============================================================================
--- incubator/shindig/trunk/javascript/container/cookies.js (original)
+++ incubator/shindig/trunk/javascript/container/cookies.js Thu Jan 22 17:59:50
2009
@@ -202,7 +202,7 @@
* @return {boolean}
*/
shindig.cookies.isEmpty = function() {
- return document.cookie == '';
+ return document.cookie === '';
};
@@ -212,7 +212,7 @@
*/
shindig.cookies.getCount = function() {
var cookie = String(document.cookie);
- if (cookie == '') {
+ if (cookie === '') {
return 0;
}
var parts = cookie.split(/\s*;\s*/);
Modified: incubator/shindig/trunk/javascript/container/gadgets.js
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/javascript/container/gadgets.js?rev=736888&r1=736887&r2=736888&view=diff
==============================================================================
--- incubator/shindig/trunk/javascript/container/gadgets.js (original)
+++ incubator/shindig/trunk/javascript/container/gadgets.js Thu Jan 22 17:59:50
2009
@@ -605,7 +605,7 @@
gadgets.IfrGadget.prototype.showUserPrefsDialog = function(opt_show) {
var userPrefsDialog = document.getElementById(this.getUserPrefsDialogId());
- userPrefsDialog.style.display = (opt_show || opt_show == undefined)
+ userPrefsDialog.style.display = (opt_show || opt_show === undefined)
? '' : 'none';
};
Modified: incubator/shindig/trunk/site/index.html
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/site/index.html?rev=736888&r1=736887&r2=736888&view=diff
==============================================================================
--- incubator/shindig/trunk/site/index.html (original)
+++ incubator/shindig/trunk/site/index.html Thu Jan 22 17:59:50 2009
@@ -67,7 +67,7 @@
var tabAnchorPrefix = "#tab-";
function changeActiveTab(activeTab, updateAnchor) {
- if (activeTab == undefined)
+ if (activeTab === undefined)
return false;
if (updateAnchor)
location.href = tabAnchorPrefix + activeTab.id;
@@ -89,7 +89,7 @@
var tabAnchor = tabAnchorRE.exec(location.href);
if (tabAnchor && tabAnchor.length == 2) {
var tabAnchorObj = document.getElementById(tabAnchor[1]);
- if (tabAnchorObj != undefined) {
+ if (tabAnchorObj !== undefined) {
changeActiveTab(tabAnchorObj, false);
return;
}
@@ -114,7 +114,7 @@
if (! divMatch || divMatch.length != 2)
return; // failed
var tabAnchorObj = document.getElementById(divMatch[1]);
- if (tabAnchorObj == undefined)
+ if (tabAnchorObj === undefined)
return; // failed
changeActiveTab(tabAnchorObj, false); //SUCCESS!
// need to set location again as browser can't navigate