Widget Library is moving to PBwiki 2.0!

We've bitten the bullet, and decided to try and make the Widget Library work under PBwiki 2.0. But we'll need your help. To this end, we've set up a blog and a forum for discussing how the existing Widget Library can best be modified to work with PBwiki 2.0. Please join us*, let us know how you use the Widget Library, and what you'd like to see happen with 2.0!

By the way, if you register on the blog first, you'll automatically be registered in the forums as well (and vice-versa).

Navigate this wiki with the SideBar tab, or view the reference materials with the QuickStart tab.

Widget: A PBwiki Javascript Library

Anyone who has visited the PBwiki forums knows that a lot of the solutions offered in there are Javascript functions. You put some code somewhere (usually your sidebar) and you can do stuff like add a toggle to the SideBar or add a button to the menu at the top of your wiki. But add a couple scripts and your code isn't so pretty and what's worse, other users have to dig through it and get all confused.


A solution for all your scripting woes

Widget is a standardized library of functions custom-tailored for PBwiki users. Just copy this code into the top of your SideBar (or if you have a tabbed V2 SideBar, the very first tab, usually QuickStart):

<script type="text/javascript" src="http://widget.pbwiki.com/f/widget_lib.js"></script>

And you're ready, with access to a bunch of functions. To use the functions, you just call them individually:

//this code adds a show/hide button to all <toc>'s
widget.toggleToc();

//this hides the Edit button
widget.hideButton("Edit page");

//this adds a Google button
widget.addButton("Google","http://www.google.com")

(Click here to try running this script)

For more information, visit HowTo to begin using these functions, or go to Reference to learn about them individually.

Note: Javascript is disabled, by default, on all PBwikis. If you want your visitors to be able to use your new features without explaining about the "Enable scripts" link, then email support@pbwiki.com and ask them to permanently enable Javascript on your wiki.

Benefits

Here are all the reasons you might want to use this library.

  1. It's made by PBwiki users for PBwiki users. We've had a lot of experience with PBwiki and enjoy close communication with the PBwiki Team and forum members. We know what users want and what's possible.
  2. Feature rich. Already, the library is full of functions useful for everybody. Between adding buttons and modifying <toc>'s, we're willing to create just about any script you can imagine.
  3. End the clutter. One script is okay. But then you add two. And three. Soon enough, your SideBar is used exclusively to dump new scripts. Use Widget and clean up that mess!
  4. Widget is standardized. We use a namespace so that all functions are called as widget.functionCall(). Because all scripts must be compiled in one place, you can be sure that the functions work well with each other. They also use a shared codebase, avoiding redundancy and keeping it all efficient.
  5. Automatically updated. Link to the file here at http://widget.pbwiki.com as shown above and never worry about having the latest stable version of the script. You'll immediately get any new functionality we add without worry.
  6. Great support system. The guys doing this are two of the most prolific members of the PBwiki forums. WE'RE ALWAYS THERE, and we answer many people within hours, if not minutes.
  7. Learn more about Javascript. The code is organized and commented, so those wanting to snoop around and figure out how a working function does something can have real-world examples. Also, we try to keep the code as simple as possible, so you don't get confused looking at the source.
  8. Even Javascript developers benefit. There are plenty of functions in the library like getElementsByClassNames (retrieve an array of elements based on the class), getElemPos (return the [x,y] coordinate of an element), and installToggle (automate the creation of a hide/show element toggle) that make your programming job easier.

Updates




Disclaimer We reserve the right to log what wikis are using Widget. The only information we intend to retain is a list of wikis using the library and what functions are being most used, for the sake of future development. If you'd rather not send us this data, click here to learn how to opt out.



Page Information

  • 1 month ago [history]
  • View page source
  • You're not logged in
  • Recent comments:
    Michael Brutsch:Comment #2
    Michael Brutsch:comment #1
    Michael Brutsch:test comment
  • Tags: home

Wiki Information

Recent PBwiki Blog Posts