Divis Blog

Just another geeks blog.

Various javascript libraries

clock March 10, 2008 22:04 by author Divi

In the last few days I got the time to read some magazines I neglected for the last 1-2 weeks. While I read them, I found some very interesting JS libraries:

 

Bevel-JS

Link: http://www.netzgesta.de/bevel/

A cool script, which enables you to modify images via javascript.

image

In the foreground, you can see the image which can be found in the example directory of the library, while in the background there're the modified images with applied image filters. Both included JS files only have an altogether size of 48kb.

 

Flot-JS

Link: http://code.google.com/p/flot/

The following code is from the example directory:

$(function () {

var d1 = [];

for (var i = 0; i < 14; i += 0.5)

d1.push([i, Math.sin(i)]);

var d2 = [[0, 3], [4, 8], [8, 5], [9, 13]];

// a null signifies separate line segments

var d3 = [[0, 12], [7, 12], null, [7, 2.5], [12, 2.5]];

$.plot($("#placeholder"), [ d1, d2, d3 ]);

});

What looks a little bit mathematical is just the description of several graphs, which look as following:

image 

This is just a simple version of what the flot-library offers. Another slightly more complex version, which consists of several different graph types can also be found in the example dir:

image

To say it with the words of a colleague of mine: "I won't need that more than once a year - but then it could be realy useful."

One nice thing about these diagrams is: The library offers methods to retrieve the values at the current cursor position and also a way to zoom the displayed diagram.

 

Ext-JS

Link: http://extjs.com

The ExtJS seems to offer some very nice controls. A screenshot of the API-Documentation of the frameworks demonstrates some of the controls, which are also used on their own page:

image

As you can see in the tree on the left-hand side, there're some very useful controls, which can be found in almost all applications. E.g.: Grid, Menu, Tree.

For the lazy guys: There're also some video tutorials available on the page ;-)

 

zXml

Link: http://nczonline.net/downloads/

If you click on the link above, you'll be redirected to a page, where you can find many nice JS-libraries. E.g. one extension extends the JS-arrays with the method "clone".

But the class I've been interested in most, offers an browser independent interface to handle XML. The JS file is only 14kb in size and offers to write code like the following:

//create a DOM document

var oXml = zXmlDom.createDocument();

//fill it with some XML

oXml.loadXML("<root><child index=\"1\"/><child index=\"2\"/> <child index=\"1\"/><child index=\"3\"/></root>");

//look around

alert("Root is: " + oXml.documentElement.tagName);

alert("First child is: " + oXml.documentElement.firstChild.tagName);

As you can see, you're able to use the usual terms like firstChild or tagName to work with the various elements and their values.

 

Dojo-Offline-Toolkit

Link: http://dojotoolkit.org/offline

The "entwickler"-magazine (edition: march/april) wrote an article about the usage of the dojo-offline-toolkit in cooperation with Google-Gears. Google-Gears offers a SQLite database and a proxy server to store dynamic content on the client to display it controlled when it's needed.

The dojo-offline toolkit doesn't add new functionality to Google-Gears, but offers some methods to ease the work with Gears. Some of the methods are the "Dojo-Storage" which can persist objects, methods to execute sql and some to download resources from the given page (called 'slurp').

 

Only for the completeness of this page are here some further links to frameworks I know:

- Prototype

- Script.Aculo.Us

- Moo-Ajax und Moo-FX

- JQuery

- ASP.Net Ajax

All of these are great frameworks which don't only focus on ajax but also add perfect effects for your page. However I assume that these frameworks are much more common and don't need any explanation here.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Sitecore Xpress released

clock February 7, 2008 23:13 by author Divi

Today it was the time I waited for. Almost as on christmas I was glad that as I entered the page of "Sitecore Xpress", there was no longer the teaser saying "Coming to a server near you...", but a nice looking download page. For sure I logged in instantly and downloaded it. Small 250MB, which needed less than 10 minutes on their way to my desktop ... the license code on the other hand took his time ... I got it at 4pm - But the waiting was worth it. Now I can finally play around with it on VISTA...

image

The commercial Sitecore (recently called "Sitecore red") had some problems with IIS on Vista ... But I think that will be also fixed on the next version, which I await shortly.

In any way - it's nice to simply ignore the small error message on the beginning (saying the IIS would not run) and just start installing it and - who would have believed - after some minutes - a browser window opened, the page appeared and it simply works. This is how it looks on my screen: 

image

That cheered my heart.

 

But what the hell is Sitecore? Sitecore is a highly developed CMS - the best I've ever seen. You almost have the like on your own desktop, if you're welcomed directly after the login with the following screen:

image

(Yes - that's a screenshot of the current version) ... so just don't wonder if the windows need a little bit longer on the first opening... .Net has to compile the libraries for the first run.

As you can see on the screenshot, the interface looks almost like an Windows-desktop ... and also the "Content Editor" corresponds to the layout of the Windows-Explorer. As a Windows user you shouldn't have any problems to find your way through the system:

image

 

So if you would gladly try that CMS, which is normally for commercial use only and which is also used in enterprise solutions: Download Sitecore Xpress in any case! It's free and you won't ever have the same kind of fun with any other CMS ;-).

 

Links

Sitecore Website

Sitecore Xpress Website (DOWNLOAD)

German Sitecore Solution Partner "netzkern GmbH"

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Center content on page

clock January 31, 2008 10:47 by author Divi

One day after another I'm having the problem of centering content in the middle of a web-page.

My default way was to enclose the whole page in <center>-tags and put matching content into it - but there're some problems with that.

But from time to time there has been some kind of solution using the "margin"-style-property. The problem: Sometimes it worked - but sometimes it didn't - here it is how you have to do it:

margin:0 auto

With this combination you tell the page "take care of the distance of the content on the left and the right side, so that they match each other.".

Explanation: The first value combines the properties margin-top and -bottom, while the second value combines the -left and -right values.

To get that working there's only one very important thing you have to remember. If you use only this property, the browser will take ALL THE PLACE IT GETS - and that means that it will just fill the whole page with the content and say "ok - space filled - no margin needed". To prevent this you have to set a specific width for the content of the page:

width: Xpx (X = numeric value for the content width)

If you use both style-properties in the tag of the main-content element, it will center automatically (no matter how wide the window is).

 

AutoMargin

 

Hint: If you're working with the <center>-tag - that also works great - you only have to align the content manually again (e.g. if you don't want the text to be centered, you have to say "text-align:left".

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Disadvantageous chosen design

clock January 9, 2008 20:35 by author Divi

As we exported a list of voucher codes today, we were shocked, because the list was completely empty. There were only two users that seemed to have entered a code, but there were just the first two digits saved.

We've searched with two persons for about 45 minutes for that bug, because we guessed that there'd be an error while saving the other parts of the code - but despite of which special cases we tried: Everything just worked fine.

After several tests we just went to the page itself and wanted to check if there'd also work everything - but it became obvious: It just was a matter of the design :-D

The place were the voucher codes should be inserted just contained two UNLABELED textboxes. Something like this:

 

The problem that occured, caused by the design, was: The left box was intended to carry the code, while the right box just should take some kind of location information (e.g. a zip or something like that) which allowed every value you entered. Because the voucher code seems to be writte with a dash, or simply just because there was no information about what to insert into the second box, the potential customers splitted the code into both fields. That caused an error in the validation, which could only be resolved, if you deleted both fields. (The reason why the first value was saved is: We didn't clean up the value, if you just entered nothing). Obviously most of the people have tried just stopped trying it after some errors ... or even left the page. That's the reason why we just got the two incomplete codes.

Note: You shouldn't assume that the people which visit your page have the same thoughts as you had when you created the page (after you thought about that for several weeks during the layout period) ;-)

Appendix: Something I forgot to say - the design was created by the customer himself.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5