You can now access all recents development in our Google Code for gWidgets page and join our gWidgets Google Groups for discussion and support!
gWidgets is a collection of simple javascript "widgets" with AJAX capability. Open-source license.
gWidgets is a simple, unobtrusive and light (roughly 20k) javascript library that delivers "widgets" for your website. It is one convenient package with several widgets included in one file and sharing common features. So far we have 4 widgets, but more will come soon.
: a simple way to show/hide (toggle) inline/ajax content.
: tab solution for inline/ajax content.
: simple modal window for image and inline/ajax content.
: tooltip solution for inline/ajax content.
Yes I know, you can already find similar widgets around the internet but my concerns in gWidgets are:
Technically speaking, follow me...
If you already use Prototype , it can be a good solution for you: 4 widgets in roughly 20k so far (including Base.js).
Of course we put a demo for you to see before downloading. You will see in this other demo that it is possible to put widgets inside other widgets as well as specific parameters.
Requirements - Of course it uses Prototype, it optionally uses Scriptaculous effects.js if available, and finally it uses Base.js (4k only) to easily and nicely create OOP due to lake of simple solution in Prototype yet (I read somewhere they plan to integrate a Base approach on v2 of Prototype).
Browsers - Because yes, we have to talk about those "guys". It works well in Firefox 1.5+, Safari, Opera9+ and IE6+ (IE5 and IE7?...due to a lack of pc around me to test..yes it can happen!).
gWidgets are mainly composed by 3 different parts: one javascript file (the brain), one css file (the style) and some images.
Part One - copy all three folders (js/, css/ and images/) inside the zip into your website.
Part Two - add the following lines into your html head tag:
Of course you can modify the src to adapt to your configuration.
Part Three (Optional) - You can change the css to look the way you want and if you want to change some of the script parameters, here is the list of currently available parameters:
is a very simple widget to toggle visibility of a inline block or, if a url is avalaible, an ajax content.
You simply create a link with the class 'gexpander' and the script will take care of the rest.
For an inline content:
your link to control the container visibility
for a remote content:
your link to control the container visibility
Notes:is a tab widget (you are using it right now to read this content!) to conveniently group inline content or, if a url is avalaible, ajax content.
You create a div tag with the class 'gtab' with the following structure:
- My Tab title
- 2nd Tab
- 3rd Tab
here is my inline content
here is my inline content for my third tab
Notes:is a modal window system for content either inline or remote. It acts also as a "lightbox"-like if the link href is an image (jpg, gif or png).
You create a link with the class 'gbox' and the script will take care of the rest.
For an inline content (it will move the container inside the modal window and show it):
show me!
for a remote content:
show me!
for an image (it will show the big size image in the modal window, resized to fit inside your browser window if necessary):
show my image
Notes:show me!
is another tooltip solution for content either inline or remote.
You create a link with the class 'gtip' and the script will take care of the rest. You can also
create a tooltip on any element adding a 'gtip' attribute to give the url. If you want a tooltip on a link where you want to keep the click on the link, you can use the attribute 'gtip' rather than the href.
The tooltip will be by default on the right unless there is not enough space then it will be positioned on the right of the element.
For an inline content (it will copy the content inside the tooltip and show it):
show me!
for a remote content:
show me!
or
show me!
Notes:show me!
GPL and MIT licenses
For those interested, these widgets are also available as helper for Symfony
I have setup a forum to easily discuss about it, feel free to join and share your comments, request new features,... You can as well subscribe to my blog RSS feed to get informed on new releases
I am also very open to share the development if you are willing to help on develop these widgets, feel free to contact me.
For the future, I am thinking to improve the code (I guess you will see that it can be improved a lot...) as well as adding new widgets.
Of course if you feel in a good mood, you can always support this project by a small donation, it will help me to continue to learn and to improve stuff along the line.
If you ask "is there any bugs?", the answer is simply: "YES"...
All those widgets are not new as such but I believe they bring a few different things and definitively cover my needs. Part of my code is inspired by some very good widgets already available and I want to acknowledge their work, namely: Fabtabulous! and jQuery Tabs plugin for the gTab. For gBox, Prototype Window and Thickbox and of course the first of all of them Lightbox JS.