Archive for the ‘Javascript’ Category

 

Richard on Aug 9th, 2008Get the filename from upload form using Javascript

I needed a way to access the filename of a file being uploaded or attached using the input file from a form. So, I created a nice little function to achieve this. Hopefully it comes in handy for someone.

function get_name_from_path(str_filepath)
{
    var obj_re = new RegExp(/([^\/\\]+)$/);
    var str_name = obj_re.exec(str_filepath);

    if (str_name […]

Richard on Jul 27th, 2008Javascript - Capitalize Each Word in a String

This is a great little function that I use to capitalize every word in a string.

function wordToUpper(str_sentence)
{
    return str_sentence.toLowerCase().replace(/\b[a-z]/g, convertToUpper);

    function convertToUpper()
    {
        return arguments[0].toUpperCase();
    }
}

Richard on Jul 21st, 2008Datejs - An Open-Source JavaScript Date Library

Datejs is an open-source JavaScript Date Library. Comprehensive, yet simple, stealthy and fast. Datejs has passed all trials and is ready to strike. Datejs doesn’t just parse strings, it slices them cleanly in two.

// What date is next thrusday?
Date.today().next().thursday();
 
// Add 3 days to Today
Date.today().add(3).days();
 
// Is today Friday?
Date.today().is().friday();
 
// Number fun
(3).days().ago();

// 6 months from now
var n = […]

Richard on Jul 18th, 2008MooCrop - A Mootools Image Cropping utility

MooCrop is an Image Cropping utility using the amazingly powerful Mootools Javascript framework. Alone it serves no practical purpose but used in conjunction with a server side script becomes a powerful image manipulation tool.

Richard on Jul 15th, 2008A configurable, AJAX file browser plugin for jQuery.

jQuery File Tree is a configurable, AJAX file browser plugin for jQuery. You can create a customized, fully-interactive file tree with as little as one line of JavaScript code.

Currently, server-side connector scripts are available for PHP, ASP, ASP.NET, JSP, and Lasso. If you’re a developer, you can easily make your own connector to work […]

Richard on Jul 11th, 2008Animated Progress Bars Using MooTools

MooTools progress bar class that animates to the desired percentage.

All you need to do is create an instance of the dwProgressBar and pass your desired options. It’s quick and easy. To move the progress bar, all you need to do is call the “set()” method, passing it the desired percentage.

Richard on Jul 6th, 2008Vista-like Ajax Calendar with Mootools

The Vista-like Ajax Calendar (vlaCalendar) is a unobtrusive web version of the slick and profound Windows Vista taskbar calendar, by using the Mootools Javascript Framework, AJAX, XHTML, CSS and PHP.

The Vista-like Ajax Calendar script is licensed under the Creative Commons Attribution- NonCommercial 3.0 License. What that means is: Use these files however you […]

Richard on Jun 15th, 2008SPAW - GPL Web Based WYSIWYG Editor Control

SPAW Editor is a web based in-browser WYSIWYG HTML editor control. It is a replacement for standard HTML textarea fields for rich text content editing. Version 2 builds on great widely acclaimed features of the first version and includes lots of exciting new features and improvements. The following are some major features that are built […]