Search the web
Sign In
New User? Sign Up
xbl-developers
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
build a XBL (web)app, save a snapshot of the visualisation, no bitm   Message List  
Reply | Forward Message #21 of 38 |
coding MozXBL1 snapshot functionality (Re: build a XBL (web)app, save a snapshot

> Within my bindings I add <stelt:insert/> right after <children/> ,
> also i add stelt:path="something" to the first element within <content>.
> "something" there actually being "root" for my top element being bound
> and kids below that, being bound get "root_0", "root_1", etc.,
> grandchildren get "root_0_0" etc.
>
> Then i have the following code to generate a valid SVGDocument, that i
> call with a bookmarklet: javascript:viewShadowSource();
>

just a few bugs left (if only Venkman didn't crash Mozilla every few
moments):

function process(shadowchunk){
var path=shadowchunk.getAttribute("stelt:path");
var clonechunk=shadowchunk.cloneNode(true);
clonechunk.removeAttribute("stelt:path");
if (path==="root") {newdoc.documentElement.appendChild(clonechunk);}
var insertshortlist;
insertshortlist=clonechunk.getElementsByTagName("stelt:insert");
//insertshortlist=clonechunk.getElementsByTagName("http://some.temporary.com","i\
nsert");
would this be different ?
alert("insertshortlist.length="+insertshortlist.length);// 0 which
is not expected
var insertchunk;
if (insertshortlist.length==1){
insertchunk=insertshortlist[0];
insertpoints[path]=insertchunk;
}
if (path!="root"){
var parentpath=path.substring(0,path.lastIndexOf("_"));
alert(insertpoints["root"]); //UNDEFINED
var insertpoint=insertpoints[parentpath];
insertpoint.parentNode.insertBefore(clonechunk, insertpoint);
}
}
function addShadow(chunk){
var anonylist=null;
var i;
try{
anonylist=document.getAnonymousNodes(chunk);
}catch(e){
//alert("caught error");
}
var n;
if (anonylist===null){n=0;}
else {n=anonylist.length;}
if (n>0){
for (i=0; i<n; i++) {process(anonylist[i]);}
}
var list=chunk.childNodes;
n=list.length;
if (n>0){
for (i=0; i<n; i++){ addShadow(list[i]);}
}
}
function viewShadowSource(){
var newwin=window.open(); //Exception
newdoc=newwin.document;
insertpoints={};
var thisdoc=document.documentElement;
addShadow(thisdoc);
var longlist=newdoc.getElementsByTagName("stelt:insert");
var n=longlist.length;
var node;
for(var i=0;i<n;i++){
node=longlist[i];
node.parentNode.removeElement(node);
}
}






Mon Apr 24, 2006 3:21 am

steltenpower
Offline Offline
Send Email Send Email

Forward
Message #21 of 38 |
Expand Messages Author Sort by Date

Imagine you have built an application with XBL cause that is a great clean way of working with you data. While using the application you at some stage get such...
steltenpower
Offline Send Email
Apr 19, 2006
1:45 am

Hi, Ruud- ... I think this is a perfectly valid use case, though I certainly can't speak for the MozXBL guys, nor can I suggest a workaround (other than...
Doug Schepers
d_a_schepers
Offline Send Email
Apr 19, 2006
9:56 pm

Workaround, to get representational snapshot, within MozXBL1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Thanks for that answer Doug. Here's...
steltenpower
Offline Send Email
Apr 22, 2006
4:46 am

... just a few bugs left (if only Venkman didn't crash Mozilla every few moments): function process(shadowchunk){ var...
steltenpower
Offline Send Email
Apr 24, 2006
3:21 am

http://steltenpower.com/xbl/xbl1.xml call "view source" use the DOM inspector then call javascript:viewShadowSource(); and in the new window call "view...
steltenpower
Offline Send Email
Apr 25, 2006
2:56 am

Hi, started a page at http://www.svgx.org with the following quote: "sXBL works much like XSLT. More specifically, it works like a special kind of XSLT...
Michael Bolger
svgfoundation
Offline Send Email
Apr 25, 2006
4:58 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help