Modified:
trunk/src/jopensocial.js
Log:
if opensocial namespace not defined,throw Error
Modified: trunk/src/jopensocial.js
==============================================================================
--- trunk/src/jopensocial.js (original)
+++ trunk/src/jopensocial.js Mon Jan 26 21:32:09 2009
@@ -18,9 +18,10 @@
* @name jQuery.gadgets */
;(function(){
+if(!window.opensocial) throw new Error("opensocial-v0.* feature is
required.");
+if(!window.gadgets.views) throw new Error("views feature is required.");
try {
var $ = jQuery; $();
- if(!window.opensocial) throw new Error("opensocial-v0.* feature is
required.");
var domain = opensocial.getEnvironment().getDomain();
} catch(e) { return; }
@@ -133,6 +134,7 @@
*/
function gadgetHeight(opt_height) {
+ if(!window.gadgets.window||!window.gadgets.window.adjustHeight) throw new
Error("dynamic-height feature is required.");
if(opt_height)
gadgets.window.adjustHeight(opt_height=="auto"?null:opt_height);
return gadgets.window.getViewportDimensions().height;
}