Compare Revisions

Jetpack Snippets

Change Revisions

Revision 119897:

Revision 119897 by Kinger on

Revision 119898:

Revision 119898 by Kinger on

Title:
Jetpack Snippets
Jetpack Snippets
Slug:
Jetpack/Snippets
Jetpack/Snippets
Content:

Revision 119897
Revision 119898
nn7    <h4>
8      Using firebug lite in a slidebar
9    </h4>
10    <pre>
11<code>jetpack.future.import("slideBar");<br><br>jetpack.slideBar.
 >append({<br>    html: &lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;bo
 >dy&gt;<br>            &lt;p&gt;some slidbar you want to debug&lt;
 >/p&gt;<br>            &lt;a href=<a class="moz-txt-link-rfc2396E"
 >>"javascript:console.log('hello!')"</a>&gt;test&lt;/a&gt;<br>    
 >        &lt;script&gt;&lt;![CDATA[<br>                //firebug l
 >ite bookmarklet code:<br>                var firebug=document.cre
 >ateElement('script');<br>                firebug.setAttribute('sr
 >c','<a class="moz-txt-link-freetext" href="http://getfirebug.com/
 >releases/lite/1.2/firebug-lite-compressed.js">http://getfirebug.c
 >om/releases/lite/1.2/firebug-lite-compressed.js</a>');<br>       
 >         document.body.appendChild(firebug);<br>                (
 >function(){if(window.firebug.version){firebug.init();}else{setTim
 >eout(arguments.callee);}})();void(firebug);<br>            ]]&gt;
 >&lt;/script&gt;<br>          &lt;/body&gt;&lt;/html&gt;,<br>    w
 >idth:  800, //wide enough to use firebug<br>    onSelect:   funct
 >ion(slide) {<br>        slide.slide(800, true);<br>    }<br>});</
 >code>
12</pre>
n8      how to use firebug lite in slidebarn14      &nbsp;
nn16    <h4>
17      Calling into a slidebar from the global jetpack scope
18    </h4>
t11<code>jetpack.future.import("slideBar");<br><br>jetpack.slideBar.t20<code>jetpack.slideBar.append({   onReady: function (slide) { </c
>append({<br>    html: &lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;bo>ode>
>dy&gt;<br>            &lt;p&gt;some slidbar you want to debug&lt; 
>/p&gt;<br>            &lt;a href=<a class="moz-txt-link-rfc2396E" 
>>"javascript:console.log('hello!')"</a>&gt;test&lt;/a&gt;<br>     
>        &lt;script&gt;&lt;![CDATA[<br>                //firebug l 
>ite bookmarklet code:<br>                var<br>firebug=document. 
>createElement('script');firebug.setAttribute('src','<a class="moz 
>-txt-link-freetext" href="http://getfirebug.com/releases/lite/1.2 
>/firebug-lite-compressed.js">http://getfirebug.com/releases/lite/ 
>1.2/firebug-lite-compressed.js</a>');document.body.appendChild(fi 
>rebug);(function(){if(window.firebug.version){firebug.init();}els 
>e{setTimeout(arguments.callee);}})();void(firebug);<br>           
>  ]]&gt;&lt;/script&gt;<br>          &lt;/body&gt;&lt;/html&gt;,< 
>br>    width:  800, //wide enough to use firebug<br>    onSelect: 
>   function(slide) {<br>        slide.slide(800, true);<br>    }< 
>br>});</code> 
21<code>    // call out to a global function, passing the slidebar 
 >object     exInitSlidebar(slide);   }, </code><code>  ... </code>
 ><code>}); </code>
22<code>function exInitSlidebar(aSlidebar) {</code>
23<code>  // This variable will now be global   slider = aSlidebar;
 > } </code>
24<code>// then, accessing the slidebar HTML: </code><code>var tl =
 > slider.contentDocument.getElementById("thumbList"); </code>
25<code>// or calling slidebar API methods or accessing properties 
 ></code><code>slider.notify();</code>

Back to History