Created
September 3, 2010 00:40
-
-
Save jcleblanc/563201 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return { | |
//push widget on the load stack | |
push: function(query, config, format, insertEl){ | |
//validate widget variables | |
if (query == null || format == null || insertEl == null){ | |
if (setupConfig["debug"] && window.console){ console.log("Missing query, return format or insert element"); } | |
return null; | |
} | |
//push widget load on the stack | |
widgetStack.push(function(){ | |
yqlWidget.init(query, config, format, insertEl); | |
}); | |
}, | |
//pop widget off the load stack and execute | |
render: function(){ | |
if (widgetStack.length > 0){ widgetStack.pop()(); } | |
}, | |
//widget initialization | |
init: function(query, config, format, insertEl){ | |
resultFormat = format; | |
queryInsert = insertEl; | |
if (config){ setupConfig = config; } | |
return getYQLData(query); | |
}, | |
//yql data caption success callback | |
getYQLDataCallback: function(o){ | |
if (! o.query){ | |
if (setupConfig["debug"] && window.console){ console.log("YQL query returned no results"); } | |
return null; | |
} | |
parseYQLResults(o.query.results); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment