Author: lindner
Date: Mon Jan 24 13:37:27 2011
New Revision: 1062769
URL: http://svn.apache.org/viewvc?rev=1062769&view=rev
Log:
minor javascript cleanups
Modified:
shindig/trunk/extras/src/main/javascript/features-extras/wave/base.js
shindig/trunk/extras/src/main/javascript/features-extras/wave/fake_gadgets.js
shindig/trunk/extras/src/main/javascript/features-extras/wave/util.js
shindig/trunk/extras/src/main/javascript/features-extras/wave/wave.ui.js
shindig/trunk/features/src/main/flex/Main.as
shindig/trunk/features/src/main/javascript/features/container/container.js
shindig/trunk/features/src/main/javascript/features/core.io/io.js
shindig/trunk/features/src/main/javascript/features/opensocial-templates/os.js
shindig/trunk/features/src/main/javascript/features/osapi/osapi.js
shindig/trunk/features/src/test/javascript/features/container/service_test.js
shindig/trunk/features/src/test/javascript/features/opensocial-data-context/datacontexttest.js
shindig/trunk/features/src/test/javascript/features/opensocial-templates/template_test.js
Modified: shindig/trunk/extras/src/main/javascript/features-extras/wave/base.js
URL:
http://svn.apache.org/viewvc/shindig/trunk/extras/src/main/javascript/features-extras/wave/base.js?rev=1062769&r1=1062768&r2=1062769&view=diff
==============================================================================
--- shindig/trunk/extras/src/main/javascript/features-extras/wave/base.js
(original)
+++ shindig/trunk/extras/src/main/javascript/features-extras/wave/base.js Mon
Jan 24 13:37:27 2011
@@ -103,7 +103,7 @@ wave.Mode = {
* @desc The blip containing the gadget is in playback mode.
*/
PLAYBACK: 4
-}
+};
wave.API_PARAM_ = "wave";
Modified:
shindig/trunk/extras/src/main/javascript/features-extras/wave/fake_gadgets.js
URL:
http://svn.apache.org/viewvc/shindig/trunk/extras/src/main/javascript/features-extras/wave/fake_gadgets.js?rev=1062769&r1=1062768&r2=1062769&view=diff
==============================================================================
---
shindig/trunk/extras/src/main/javascript/features-extras/wave/fake_gadgets.js
(original)
+++
shindig/trunk/extras/src/main/javascript/features-extras/wave/fake_gadgets.js
Mon Jan 24 13:37:27 2011
@@ -33,7 +33,7 @@ gadgets.util.getUrlParameters = function
params[waveParamName] = true;
params.hasOwnProperty = function(key) {
return !!this[key];
- }
+ };
return params;
};
Modified: shindig/trunk/extras/src/main/javascript/features-extras/wave/util.js
URL:
http://svn.apache.org/viewvc/shindig/trunk/extras/src/main/javascript/features-extras/wave/util.js?rev=1062769&r1=1062768&r2=1062769&view=diff
==============================================================================
--- shindig/trunk/extras/src/main/javascript/features-extras/wave/util.js
(original)
+++ shindig/trunk/extras/src/main/javascript/features-extras/wave/util.js Mon
Jan 24 13:37:27 2011
@@ -29,7 +29,7 @@ wave.util.SPACES_ = '
wave.util.toSpaces_ = function(tabs) {
return wave.util.SPACES_.substring(0, tabs * 2);
-}
+};
wave.util.isArray_ = function(obj) {
try {
Modified:
shindig/trunk/extras/src/main/javascript/features-extras/wave/wave.ui.js
URL:
http://svn.apache.org/viewvc/shindig/trunk/extras/src/main/javascript/features-extras/wave/wave.ui.js?rev=1062769&r1=1062768&r2=1062769&view=diff
==============================================================================
--- shindig/trunk/extras/src/main/javascript/features-extras/wave/wave.ui.js
(original)
+++ shindig/trunk/extras/src/main/javascript/features-extras/wave/wave.ui.js
Mon Jan 24 13:37:27 2011
@@ -33,7 +33,7 @@
if (typeof wave == "undefined") {
wave = {};
-};
+}
if (typeof wave.ui == "undefined") {
/**
@@ -41,7 +41,7 @@ if (typeof wave.ui == "undefined") {
* look & feel inside a gadget.
*/
wave.ui = {};
-};
+}
wave.ui.BASE = 'http://wave-api.appspot.com/public/';
@@ -59,12 +59,12 @@ wave.ui.loadCss = function() {
return;
}
wave.ui.cssLoaded = true;
- var fileref = document.createElement("link")
- fileref.setAttribute("rel", "stylesheet")
- fileref.setAttribute("type", "text/css")
- fileref.setAttribute("href", wave.ui.BASE + "wave.ui.css")
- document.getElementsByTagName("head")[0].appendChild(fileref)
-}
+ var fileref = document.createElement("link");
+ fileref.setAttribute("rel", "stylesheet");
+ fileref.setAttribute("type", "text/css");
+ fileref.setAttribute("href", wave.ui.BASE + "wave.ui.css");
+ document.getElementsByTagName("head")[0].appendChild(fileref);
+};
/**
* Converts the passed in target into a wave-styled button.
Modified: shindig/trunk/features/src/main/flex/Main.as
URL:
http://svn.apache.org/viewvc/shindig/trunk/features/src/main/flex/Main.as?rev=1062769&r1=1062768&r2=1062769&view=diff
==============================================================================
--- shindig/trunk/features/src/main/flex/Main.as (original)
+++ shindig/trunk/features/src/main/flex/Main.as Mon Jan 24 13:37:27 2011
@@ -65,7 +65,7 @@ class Main {
if ((to_origin === "*" || to_origin === my_origin) && target_id ===
channel_recv_id) {
ExternalInterface.call("gadgets.rpctx.flash._receiveMessage",
target_id, message, from_origin, to_origin);
}
- }
+ };
ExternalInterface.addCallback("sendMessage_" + channel_recv_id, { },
function(message:String, to_origin:String) {
if (!to_origin) to_origin = "*";
Modified:
shindig/trunk/features/src/main/javascript/features/container/container.js
URL:
http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/container/container.js?rev=1062769&r1=1062768&r2=1062769&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/container/container.js
(original)
+++ shindig/trunk/features/src/main/javascript/features/container/container.js
Mon Jan 24 13:37:27 2011
@@ -422,7 +422,7 @@ shindig.container.ContainerRender.WIDTH
/**
* Add list of gadgets to preload list
- * @param {Object} hash of gadgets data
+ * @param {Object} response hash of gadgets data
* @private
*/
shindig.container.Container.prototype.addPreloadGadgets_ = function(response) {
@@ -437,7 +437,7 @@ shindig.container.Container.prototype.ad
}
}
}
-}
+};
/**
@@ -457,7 +457,7 @@ shindig.container.Container.prototype.pr
this.service_.addGadgetMetadatas(gadgets, refTime);
this.service_.addGadgetTokens(tokens, refTime);
this.addPreloadGadgets_(gadgets);
-}
+};
/**
Modified: shindig/trunk/features/src/main/javascript/features/core.io/io.js
URL:
http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.io/io.js?rev=1062769&r1=1062768&r2=1062769&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/core.io/io.js (original)
+++ shindig/trunk/features/src/main/javascript/features/core.io/io.js Mon Jan
24 13:37:27 2011
@@ -239,7 +239,7 @@ gadgets.io = function() {
* @param {function(string,function(Object),Object,Object)}
* processResponseFunction The function that should process the
* response from the sever before calling the callback.
- * @param {string=} opt_contentType - Optional content type defaults to
+ * @param {string=} opt_headers - Optional headers including a Content-Type
that defaults to
* 'application/x-www-form-urlencoded'.
*/
function makeXhrRequest(realUrl, proxyUrl, callback, paramData, method,
@@ -426,7 +426,7 @@ gadgets.io = function() {
var proxyUrl = config.jsonProxyUrl.replace('%host%',
document.location.host);
// FIXME -- processResponse is not used in call
- if (!respondWithPreload(paramData, params, callback, processResponse)) {
+ if (!respondWithPreload(paramData, params, callback)) {
if (httpMethod === 'GET' && refreshInterval > 0) {
// this content should be cached
// Add paramData to the URL
Modified:
shindig/trunk/features/src/main/javascript/features/opensocial-templates/os.js
URL:
http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/opensocial-templates/os.js?rev=1062769&r1=1062768&r2=1062769&view=diff
==============================================================================
---
shindig/trunk/features/src/main/javascript/features/opensocial-templates/os.js
(original)
+++
shindig/trunk/features/src/main/javascript/features/opensocial-templates/os.js
Mon Jan 24 13:37:27 2011
@@ -38,7 +38,7 @@ os.defineBuiltinTags = function() {
value = node.innerHTML;
}
- var parsedValue = gadgets.json.parse(value)
+ var parsedValue = gadgets.json.parse(value);
if (parsedValue) {
value = parsedValue;
Modified: shindig/trunk/features/src/main/javascript/features/osapi/osapi.js
URL:
http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/osapi/osapi.js?rev=1062769&r1=1062768&r2=1062769&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/osapi/osapi.js
(original)
+++ shindig/trunk/features/src/main/javascript/features/osapi/osapi.js Mon Jan
24 13:37:27 2011
@@ -53,7 +53,7 @@
feralCallback.call(that, batchResult[method]);
}
});
- }
+ };
if (has___) {
___.markInnocent(boundCall.execute, 'execute');
}
Modified:
shindig/trunk/features/src/test/javascript/features/container/service_test.js
URL:
http://svn.apache.org/viewvc/shindig/trunk/features/src/test/javascript/features/container/service_test.js?rev=1062769&r1=1062768&r2=1062769&view=diff
==============================================================================
---
shindig/trunk/features/src/test/javascript/features/container/service_test.js
(original)
+++
shindig/trunk/features/src/test/javascript/features/container/service_test.js
Mon Jan 24 13:37:27 2011
@@ -162,7 +162,7 @@ ServiceTest.prototype.testUpdateResponse
service.addGadgetMetadatas({'id' : data}, 104);
this.assertEquals("id", data.url);
this.assertEquals(121, data.localExpireTimeMs);
-}
+};
ServiceTest.prototype.testAddToCache = function() {
var service = new shindig.container.Service();
@@ -176,6 +176,6 @@ ServiceTest.prototype.testAddToCache = f
this.assertTrue(122, cache["id1"].localExpireTimeMs);
this.assertTrue(152, cache["id2"].localExpireTimeMs);
-}
+};
Modified:
shindig/trunk/features/src/test/javascript/features/opensocial-data-context/datacontexttest.js
URL:
http://svn.apache.org/viewvc/shindig/trunk/features/src/test/javascript/features/opensocial-data-context/datacontexttest.js?rev=1062769&r1=1062768&r2=1062769&view=diff
==============================================================================
---
shindig/trunk/features/src/test/javascript/features/opensocial-data-context/datacontexttest.js
(original)
+++
shindig/trunk/features/src/test/javascript/features/opensocial-data-context/datacontexttest.js
Mon Jan 24 13:37:27 2011
@@ -79,7 +79,7 @@ DataContextTest.prototype.testRegisterLi
listenerCalledWithKey = null;
context.putDataSet('key', 3);
this.assertEquals('key', listenerCalledWithKey[0]);
-}
+};
/**
* Test registerListener()
@@ -104,7 +104,7 @@ DataContextTest.prototype.testRegisterLi
context.putDataSet('aone', 3);
this.assertEquals('aone', listenerCalledWithKey[0]);
-}
+};
/**
* Test registerListener() with '*'
@@ -126,7 +126,7 @@ DataContextTest.prototype.testRegisterLi
context.putDataSet('two', 2);
this.assertEquals('two', listenerCalledWithKey[0]);
-}
+};
/**
* Test getData()
@@ -142,7 +142,7 @@ DataContextTest.prototype.testGetData =
var data = context.getData();
data['key'] = 'ball';
this.assertEquals('value2', context.getDataSet('key'));
-}
+};
/**
* Test putDataSets()
@@ -154,7 +154,7 @@ DataContextTest.prototype.testPutDataSet
var listener = function(keys) {
counter++;
passedKeys = keys;
- }
+ };
context.registerListener(['sets1', 'sets2'], listener);
context.putDataSets({ sets1: 'a', sets2: 'b' });
this.assertEquals('a', context.getDataSet('sets1'));
@@ -165,7 +165,7 @@ DataContextTest.prototype.testPutDataSet
// Test that listener was passed both keys.
this.assertEquals(2, passedKeys.length);
-}
+};
/**
* Test registerOneTimeListener_()
@@ -175,10 +175,10 @@ DataContextTest.prototype.testOneTimeLis
var counter = 0;
var listener = function(keys) {
counter++;
- }
+ };
context.registerOneTimeListener_('oneTime', listener);
context.putDataSet('oneTime', 'foo');
this.assertEquals(1, counter);
context.putDataSet('oneTime', 'bar');
this.assertEquals(1, counter);
-}
\ No newline at end of file
+};
\ No newline at end of file
Modified:
shindig/trunk/features/src/test/javascript/features/opensocial-templates/template_test.js
URL:
http://svn.apache.org/viewvc/shindig/trunk/features/src/test/javascript/features/opensocial-templates/template_test.js?rev=1062769&r1=1062768&r2=1062769&view=diff
==============================================================================
---
shindig/trunk/features/src/test/javascript/features/opensocial-templates/template_test.js
(original)
+++
shindig/trunk/features/src/test/javascript/features/opensocial-templates/template_test.js
Mon Jan 24 13:37:27 2011
@@ -148,8 +148,8 @@ function assertTemplateDomEquals(lhs, rh
*
* @param {string} templateText The text of the inline template to evaluate
* @param {string} output The expected output
- * @param {?Object} context The data context
- * @param {?Array<String>} namedTemplates Array of text of namedTemplates
+ * @param {Object=} context The data context
+ * @param {Array<String>=} namedTemplates Array of text of namedTemplates
*/
function assertTemplateOutput(templateText, output, context,
namedTemplates) {
@@ -706,7 +706,7 @@ function testOnAttachAttribute() {
function testSpacesAmongTags() {
var tryTemplateContent = function(templateText) {
- var output = os.compileTemplateString(templateText).render();
+ var output = os.compileTemplateString(templateText).render();
assertEquals('Hello world!', domutil.getVisibleTextTrim(output));
};
@@ -737,7 +737,7 @@ function testVariablePrecedence() {
var tryTemplateContent = function(templateText, data) {
var output = os.compileTemplateString(templateText).render(data);
assertEquals('Right', domutil.getVisibleTextTrim(output));
- }
+ };
os.Loader.loadContent('<Templates xmlns:os="uri:unused">' +
'<Template tag="os:msg">${Value}</Template></Templates>');
@@ -787,4 +787,4 @@ function testOsVar() {
'<div><os:Var key="counter">{"key" : "value"}</os:Var>${counter.key}</div>',
'<div>value</div>',
{});
-}
\ No newline at end of file
+}