Showing posts with label Blogging. Show all posts
Showing posts with label Blogging. Show all posts

Saturday, April 11, 2009

Syntax Highlighting 2.0 on Blogger

I previously blogged about adding code and displaying it nicely in your blog posts.

Back on February 3, 2009 Syntax Highlighting 2.0 was released. It is much nicer than the previous versions and the clipboard feature now works properly - It's also backward compatible or rather it upgrades the old 1.5 style to the 2.0 style without needing to touch all those old blog posts. Cool, ay?

Inspired by FaziBear, I am providing here a widget that can be used to add SH2.0 to your Blogger so you don't need to worry about the details or go through the trouble I did.

Note: If you have the old version installed via a widget or directly in your template, remove it; it's simply nolonger needed.
There is one caveat: Because everything is inlined, you won't get any updates to the remote JS and CSS code. On the otherhand, your blogs will be stable and won't be susceptible to any errors in those updates. Enjoy!

Monday, February 16, 2009

How To: Demo Flex Apps On Blogger or Google Sites

While working on my new Flexins Project and blogging accordingly, I discovered that you can embed you Flex application into your page quite easily. Here are the rawest of raw instructions on how to do it.
Flex on Blogger
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    id="Main" width="100%" height="100%"
    codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
    <param name="movie" value="https://sites.google.com/site/flexinsproject/flexins-catalog/dndmixin/dnd-mixin-demo-0.2.swf?attredirects=0" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#869ca7" />
    <param name="allowScriptAccess" value="sameDomain" />
    <embed src="https://sites.google.com/site/flexinsproject/flexins-catalog/dndmixin/dnd-mixin-demo-0.2.swf?attredirects=0" quality="high" bgcolor="#869ca7"
        width="100%" height="100%" name="Main" align="middle"
        play="true"
        loop="false"
        quality="high"
        allowScriptAccess="sameDomain"
        type="application/x-shockwave-flash"
        pluginspage="http://www.adobe.com/go/getflashplayer">
    </embed>
</object>
UPDATE, 27.02.2009: It seems Blogger ignores the <object>...</object> tags, so the nested <embed>...</embed> is sufficient. While I would not normally recommend removing robustness... parts of the <object>...</object> code was showing in my blog, so I got rid of it altogether. Also make sure the remaining <embed>...</embed> is format correctly i.e. no erroneous newlines; this was causing some of the parameters e.g. width and height, to be ignored.
Flex on Google Sites
<Module>
    <ModulePrefs title="__UP_title__"
    width="600"
    height="450"
    scrolling="true"
    author="Darren Bishop"
    author_email="dbishop81@gmail.com"
    description="GG to help embed Flex applications into Blogger or Google Sites">
        <Require feature="flash" />
    </ModulePrefs>
    <UserPref name="title" display_name="Title" default_value="Flex Application Embedder" />
    <UserPref name="swf_url" display_name="SW URL" />
    <Content type="html">
    <![CDATA[
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
        id="Main" width="100%" height="100%"
        codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
        <param name="movie" value="__UP_swf_url__" />
        <param name="quality" value="high" />
        <param name="bgcolor" value="#869ca7" />
        <param name="allowScriptAccess" value="sameDomain" />
        <embed src="__UP_swf_url__" quality="high" bgcolor="#869ca7"
            width="100%" height="100%" name="Main" align="middle"
            play="true"
            loop="false"
            quality="high"
            allowScriptAccess="sameDomain"
            type="application/x-shockwave-flash"
            pluginspage="http://www.adobe.com/go/getflashplayer">
        </embed>
    </object>
    ]]>
    </Content>
</Module>
Wordpress
Sorry, you are on your own. Somehow, I don't think it would be that hard to do. If you can't figure it out, feel free to ask for help. Cheers