|
demogwtshare
demo gwt share button integration
ReferenceMy goal is to add buttons dynamically integrated into GWT so I can add the states, instead of pages into the url link. I doing something like this on my http://c.gawkat.com Javascript IncludeGoogle buzz javascript private void setupBuzzScript() {
Document doc = Document.get();
ScriptElement script = doc.createScriptElement();
script.setSrc("http://www.google.com/buzz/api/button.js");
script.setType("text/javascript");
script.setLang("javascript");
doc.getBody().appendChild(script);
}
Google Buzz Html String s = "<a " +
"href=\"http://www.google.com/buzz/post\" " +
"class=\"google-buzz-button\" " +
"title=\"Check out this GWT Share Demo\" " +
"data-message=\"I made this to test out some sharing buttons.\" " +
"data-url=\"http://demogwtshare.appspot.com\" " +
"data-imageurl=\"http://demogwtshare.appspot.com/images/preview.jpg\" " +
"data-locale=\"en\" " +
"data-button-style=\"normal-count\"></a>";
getHBuzz().setHTML(s);Twitter IncludeHere is how I dynamically add the twitter javascript into the gwt app. private void drawTwitter() {
//<a href="http://twitter.com/Gawkat" class="twitter-follow-button" data-show-count="false">Follow @Gawkat</a>
//<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
String s = "<a href=\"http://twitter.com/Gawkat\" class=\"twitter-follow-button\" data-show-count=\"false\">Follow @Gawkat</a>";
HTML h = new HTML(s);
fpTwitter.add(h);
Document doc = Document.get();
ScriptElement script = doc.createScriptElement();
script.setSrc("http://platform.twitter.com/widgets.js");
script.setType("text/javascript");
script.setLang("javascript");
doc.getBody().appendChild(script);
}Google Plus One +1Simple way to add +1 to your GWT App. Include the script tag into the java code like this:
Gadget XMLI can't get this to work as of yet. But here is gadget include. Try 1.
|
► Sign in to add a comment