Auto-Growing Textarea with jQuery and MooTools

AutoGrowing Textarea JQuery Plugin was inspired by Facebook’s auto-expanding text areas and makes it easy to have auto-growing textareas. The textarea grows and shrinks to fit it’s content, but does not exceed the minimum height you specify via CSS.

jquery-growing-textarea

Required TextArea CSS Attributes:

  • line-height
  • min-height

You are required to have some basic styles for your textarea for it to work properly, but it’s really not that hard. The solution is simply to create a hidden div that mimics the textarea’s style and then when the height of the div surpasses the height of the textarea, we adjust the size of the textarea.

Flext: MooTools Auto-Growing Textrea Plugin, by Graham McNicoll

flext-mootools auto-growing-textrea-plugin

Features include:

  • Very easy to implement
  • Grows text areas when needed
  • Maximum Height to Grow To
  • Can grows parents if they have a fixed height
  • Ghost text/text overlay for input context and help
  • Text input emulation (enter can submit form, instead of new line)

UIZE, a free powerful Open Source object oriented JavaScript Framework

UIZE, free open source JavaScript ToolBox allows you to create more effective user interfaces in your Web-Based applications and services. This framework implements systems for JavaScript Inheritance, JavaScript Events, JavaScript Templates, JavaScript Widgets, JavaScript Code Compression and many more powerful capabilities.

uize

Features include:

  • It is server agnostic (can be used with any choice of server language and platform)
  • Does not extend native objects, and supports interoperability with other libraries that adhere to this principle
  • Supports widgets, AJAX, DOM, templates, and more

You can call it an “Ajax Framework”, an “Ajax Toolkit”, a “JavaScript Framework”, a “JavaScript API”, a “JavaScript Toolkit”, a “JavaScript Toolbox”… whatever you like! We call it the UIZE JavaScript Framework (or just “UIZE” for short).

Extract Colors from Images and Make Color Schemes: ColorSuckr

ColorSuckr, a project by Paul Burgess, is useful to create color schemes based on photos for use in your artwork & designs. The application extracts the most common 12 colors from the submitted image and also gives you the option to see the color scheme for each one. You can drag and drop the color results around the page, click on the color strip, hold and drag, let go to drop. The color text can also be shown and hidden by clicking the small grey dot next to the strip. ColorSuckr has also a nice feature: if you enter the URL to a web page, all the images that are found in that page are retrieved so you can choose which one would be parsed. Things can get even easier with the ColorSuckr Add-on for the FireFox browser. After you install the add-on, you can simply right click any image on a webpage and choose ‘Extract Image Colors’.

colorsuckr

Creating iPhone-style Checkboxes with jQuery and Prototype

iPhone-style Checkboxes is a progressive enhancement for standard HTML checkboxes which transforms them into the beautiful iPhone toggle switches. The change is purely visual as the underlying checkbox is not touched. The usage of the iphone-style-checkboxes library is very simple. Unzip the downloaded package, place the JavaScript, images and stylesheet where you please. Make sure to update the stylesheet to point to the new location of your images, if they have changed relative to the stylesheet.

Read more from this entry…

Encrypt the POST-GET Data when you Submit a Form: jCryption

jCryption is a JavaScript HTML-Form Encryption JQuery Plugin, which encrypts the POST/GET-Data that is sent when a form is submitted. For the calculation it uses the Multiple-precision and Barrett modular reduction libraries and JQuery. The data is encrypted on the client side (JavaScript) and decrypted on the server (PHP).

jcryption

Features include:

  • It is easy to install, use and extend
  • RSA form data encryption up to 2048 bit
  • AjaxSubmit supported
  • no SSL required
  • Does not block the browser on calculations

jCryption first serializes the form, converts the string into hexadecimal values which is required to encrypt it. When the keypair was generated on the server, the script receives it, encrypts the string with the public key and sends it to the sever where the string will be decrypted. When this is done you have your original serialized string back which is equal to a normal form submit (GET or POST).

How to Replace and Modify Content Between Two Delimiters in PHP

A while ago I have written a short tutorial of how you can write a short PHP function to extract content from specific delimiters. I has come to my attention that many people are looking for a way to replace and even modify content between 2 delimiters. Therefore I have decided to write a script that can help them with this endeavor. Uses regular expressions to find and parse the matched content.

Replace all the content found between the delimiters

function replace_content_inside_delimiters($start, $end, $new, $source) {
return preg_replace('#('.preg_quote($start).')(.*?)('.preg_quote($end).')#si', '$1'.$new.'$3', $source);
}

As you can see the function uses 4 arguments. The first 2 two are the delimiters (the beginning and the ending one), the 3d is the replacement string and the last one is the main source that is parsed.

$data = '<body><div class="wrap"><div class="inside">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div></div></body>';

$start = '<div class="inside">';
$end =  '</div>';

$replace_with = 'PHP: Hypertext Preprocessor';

$str = replace_content_inside_delimiters($start, $end, 'PHP: Hypertext Preprocessor', $data);

echo $str;

// Result: <body><div class="wrap"><div class="inside">PHP: Hypertext Preprocessor</div></div></body>'

Filter the content found between the delimiters

In case you need to modify the text between the delimiters here’s how you can do it:

$source = '<div class="subtitle">PHP is a widely-used general-purpose scripting language for web development.</div>';

$start = '<div class="subtitle">';
$end = '</div>';

$data = preg_replace('#('.preg_quote($start).')(.*?)('.preg_quote($end).')#si', '$1'.parse_content($new).'$3', $source);

function parse_content($content) {
$words = array('PHP', 'scripting', 'development'); // Let's bold some words!

foreach($words as $word) {
$content = str_replace($word, '<strong>'.$word.'</strong>', $content);
}

return $content;
}

How it works?

The regex uses the \s and the \i modifiers. The former (aka: DOTALL) makes dot a special character that matches newlines too. The later matches the characters in insensitive mode.

Simple and Easy to Customize XML based CMS: GetSimple

If you are looking for a way to manage a small business site, GetSimple, a XML based lite Content Management System, is the simplest way to do that. It doesn’t use MySQL to store the information. Instead it depends on the speed and accuracy of XML. This way you can stay away from an extra layer of slowness and complexity associated with connecting to a MySQL database. The application is very simple to install and easy to customize.

Features include:

  • XML based data storage
  • Best-in-Class User Interface
  • ‘Undo’ protection & backups
  • Easy to theme
  • Great documentation

getsimple-cms

Designed For the Small-Site Market
This is one of the reasons GetSimple uses XML rather than a robust database such as mySQL. For most small businesses, their only real need is to be able to easily update their site without the need of a ton of extraneous rarely used features. GetSimple’s goal is to manage small websites efficiently and effectively.

Free, Simple and Fully Customizable Flash XML Quiz

Simple XML Quiz is a new quiz application released by Flabell. It supports unlimited questions and answers (only one correct answer is allowed for each question). The question’s height, text color, size etc. are all customizable in the XML files. The quiz can be easily used in your Flash projects or as an independent Flash Quiz component on your HTML based website. Skinning is also simple. You do not need any Flash experience since all the settings are loaded from the external customizable XML file.

General details:

  • Opens with: Flash CS3+
  • Resolution: Resizeable
  • Published size: 140kb
  • ActionScript version: AS3

free-simple-xml-quiz

Each question has exactly one correct answer, and in order to continue to the next question, it’s mandatory for the user to choose one answer. For each correct answer, the user receives one point. For each incorrect answer, the user receives zero points.

Create, Customize and Send Newsletters: MeeNews

MeeNews is a WordPress Plugin useful if you need to send newsletters. It is compatible with WordPress 2.7+, has two different themes ready to use, a completely customizable design, a clean and user friendly interface and it is available in 2 languages: English and Spanish. You do not need any programming knowledge to use this plugin, as it is very easy to use. You can even add you existing posts to the newsletter.

meenews

MeeNews is the most complete all-in-one email marketing wordpress plugin, for newsletter creation. Looking for a good email marketing option to integrate into your website or blog? Look no further, MeeNews is what you are looking for!

Easily Integrate your ‘Buy Sell Ads’ Zones in your WordPress Blog

‘Buy Sell Ads’ WordPress Plugin aims to help you with an easy method of ‘Buy Sell Ads’ zones integration into your WordPress Blog. The script includes an anti-AdBlock measure to help preventing AdBlock from blocking the advertisements. Some of the reasons Thaya Kareeson created this plugin are:

  • AdBlock lowers your ad impression statistics tracked by Buy Sell Ads, which makes your advertisement spot lose value.
  • Buy Sell Ads advertisers will have an extra incentive to advertise on your site because AdBlock will not be able to block their ads.

buy-sell-ads

Please resist the urge to flame this plugin just because you are an AdBlock lover. I did not write this plugin because I hate AdBlock, but rather because I love publishers and their quality content. I truly believe that this is a useful plugin. If you are planning on rating this plugin, please give it a fair chance by downloading it and evaluating it before you rate.

Features include:

  • Easily integration of the BSA advertisements (all you need is the zone ID)
  • Anti-AdBlock capabilities
  • Buy Sell Ads widget that support multiple zones
  • Ability to specify pre/post zone HTML & pre/post widget HTML