IFrame Sample

Thanks tod ToddOs, my module has now been submitted and it's working...
The 10 downloads I got so far don't really compare well to the 15,000 hits I get from G**gle per day, but what the hell, at least I'm learning :)
Anyway, since the script appears to work well, I think it could potentially be useful to others as well. Here are the individual files, which have to be packaged into a ZIP file for submission. This will load an iframe from http://www.tapper-ware.net/patience/live/patience.htm , resize it to width=100% and height=224px

==== gadget.xml: ====

< xml version="1.0" >
<rss version="2.0" xmlns:binding="http://www.live.com">
<channel>
<title>Solitaire / Patience</title>
<description>You know Solitaire, right But now you can play it inside your browser: Anywhere</description>
<language>en-us</language>
<binding:type>Schmucker.Hans.Game.Patience</binding:type>
<item>
<link>patience.js</link>
</item>
<item>
<link binding:type="css">patience.css</link>
</item>
<icons>
<icon height="32" width="32">patience.gif</icon>
</icons>
</channel>
</rss>

==== patience.js: ====

registerNamespace("Schmucker.Hans.Game");

Schmucker.Hans.Game.Patience = function(p_elSource, p_args, p_namespace){
  Schmucker.Hans.Game.Patience.initializeBase(this, arguments);
    var m_this = this;
    var m_el = p_elSource;
  this.iframe=null;
  
  this.initialize = function(p_objScope){
    Schmucker.Hans.Game.Patience.getBaseMethod(this, "initialize", "Web.Bindings.Base").call(this, p_objScope);
    m_this.iframe=document.createElement("iframe");
    m_this.iframe.src="http://www.tapper-ware.net/patience/live/patience.htm";
    m_this.iframe.style.padding="0px";
    m_this.iframe.style.margin="0px";
    m_this.iframe.style.width="100%";
    m_this.iframe.style.height="228px";
    m_el.appendChild(m_this.iframe);
    m_el.style.height=m_this.iframe.style.height;
  }

  this.dispose = function(p_blnUnload){
    m_this.iframe.parentNode.removeChild(m_this.iframe);
    Schmucker.Hans.Game.Patience.getBaseMethod( this, "dispose", "Web.Bindings.Base").call(this, p_blnUnload);
    Schmucker.Hans.Game.Patience.registerBaseMethod(this, "dispose");
  }
}

Schmucker.Hans.Game.Patience.registerClass("Schmucker.Hans.Game.Patience", "Web.Bindings.Base");

==== patience.css: ====
Empty

==== patience.gif: ====
A 32x32 transparent GIF that serves as icon

==== patience.jpg: ====
A 100x100 JPEG that contains a screenshot for the gallery.



Answer this question

IFrame Sample

  • hrubesh

    hi Hans,

    What Drs.P means, is that the gadgets are nicer when written whith your own js file, and the DOM construction in this js file, it is a bit more difficult to do, and Drs.P also built by himself the inside elements like flash or all this kind of stuff....So it 's hand made 100%, whithout calling some one else stuff....everybody can't do that, but that's the direction every body has to take little by little.

    Lot of time and silly brain storming...(he could say this with a bright friendly smile)

    albidochon


  • paragp

    The big difference is that the content of the iframe was written to adjust to various widths properly... sadly thats not true for the majority of those gadgets.
  • Nate Garvey

     Hans_Schmucker wrote:
    The elements are actually constructed via JS and I've written it myself... I simply don't want to maintain different versions for g**gle and live.

    That's perfectly valid, but in terms of developer "cred" on a forum for Live gadgets, that approach isn't going to earn you much. :)

    Anyway, hopefully someday soon you won't have to manage two separate gadget codebases.  See http://liveside.net/blogs/developer/archive/2006/11/13/live-com-to-support-google-universal-gadgets.aspx.  I'm of mixed feelings about that (why should Microsoft switch to Google's format rather than vice versa, considering Microsoft was doing online gadgets well before Google -- yes, really, start.com, the live.com predecessor, was doing gadgets months before google/ig went into beta), but if it gets more people interested in building gadgets for Live then I guess it's not so bad.


  • Lockhouse

    I never said it wouldn't be a waste of resources. That's just something you have to decide for yourself. For me, I build gadgets for fun (I'm weird that way, I guess). Most of the fun in building a gadget is in utilizing the framework, DHTML, Javascript, and CSS to create a cool gadget. Building a YAIG (Yet Another Iframe Gadget) holds no appeal for me because it's not technically challenging (and thus not fun). Considering this is a forum for Windows Live gadget developers, I would think it's fairly obvious what's important here. That's not to say that building YAIGs is bad, or that they can't be useful or cool on their own. It's just not something I would aspire to myself :).

    3D in Javascript might be cool (though I'm having flashbacks to VRML and wanting to vomit). 3D in a gadget would be even cooler. 3D in a non-iframe, non-Flash, 100% pure Javascript/DHTML/CSS gadget would be the coolest. But that's my bias speaking :)

    Let me just reiterate -- I'm not making a value judgement on your decisions. I'm simply saying that I wouldn't make the same ones you have, because I have different priorities. Those priorities are neither better nor worse, just different.


  • Flap

    Wow great... There are hundreds of these iframe gadgets rather boring

  • Xancholy

    Wouldn't that simply be a waste of resources I mean, sure I can do it, but what for I'm not using any live.com or g**gle.com/ig functionality and it's hard enough to pull it off in InternetExplorer even without having to worry about two different platforms.

    Don't you think the time is better spent on something a bit more interesting like 3D in Javascript (Firefox and Opera only so far... there's no point implementing the Canvas wrapper code until everything is working perfectly with native support)

  • aj_army

    The elements are actually constructed via JS and I've written it myself... I simply don't want to maintain different versions for g**gle and live.

  • IFrame Sample