public
Description: A jQuery plugin for blog-side javascript
Home | Edit | New

Home

This plugin is the first of many jQuery plugins I hope to release that will start to shift the Movable Type javascript paradigm towards a more sane, robust and intelligible system. This particular plugin was conceived from the desire to make it easier to update the greeting text that is displayed to users above comment forms.

In truth there are actually two plugins contained in this project:

  • jquery.mtauth.js
  • jquery.mtgreet.js

The first of these plugins provides the framework for establishing a user session on a blog. It can fetch a user’s session via JSONp from the main application, log a user out, etc. It will then fire events accordingly.

The second plugin leverages this base for registering callbacks of its own to surface greeting text on a page according to a string format you specify.

Resources

Sample Code

Wanna know what the javascript for an MT blog looks like when using this plugin? Here you go:


    <html>
      <head>
        <script type="text/javascript" src="mt.js"></script>
        <script type="text/javascript" src="jquery.js"></script>
        <script type="text/javascript" src="jquery.mtauth.js"></script>
        <script type="text/javascript" src="jquery.mtgreeting.js"></script>
        <script type="text/javascript">
        $(document).ready(function() {
          $('#greeting').greet();
        });
        </script>
      </head>
      <body>
        <div id="greeting"></div>
      </body>
    </html>
Last edited by byrnereese, Fri May 15 12:49:55 -0700 2009
Home | Edit | New
Versions: