Plugins Directory

You are not logged in. Log In

Recent Additions

Filed under: Files > Response Commands, Javascript

xajax.ext.SWFupload 0.2.1

This plugin allows uploading files using the SWFUpload JavaScript/Flash library. You can easily convert your existing input fields into 'swf upload fields'. SWFUpload offers many configuration settings to limit all kind of file parameters (size,type,number,..) and leaves the UI to the browser.

« DEMO »

changelog

2008-04-11 vers 0.2.1
  • fixed bug were response wasn't processed in IE
2008-04-10 vers 0.2
  • changed base class to xajaxResponsePlugin
  • added response function to transform forms/fields via xajax
  • added destroy function to unload swf movie and containers
  • added response functions for destroying fields/forms
  • added callback events
  • added config parameter 'multiple'
  • added compressed JS files
  • fixed bug in upload rate
  • fixed bug where xajax request wasn't send when queue was empty
2008-04-07 vers 0.1
  • first release

supported configurations

  • PHP 5.x
  • any webserver
  • Flash 9
  • Xajax 0.5

install

Just copy the "swfupload" folder into your xajax install below /xajax/xajax_plugins/request/.
If you have downloaded the full package just replace your old xajax install with the provided xajax folder. Do not copy the new folder into the old one!

usage

configuration

function registration

JavaScript functions

response functions

include the plugin right after the xajax object instantiation and before configuring xajax.

$xajax = new xajax();
require_once './xajax/xajax_plugins/request/swfupload/swfupload.inc.php';
$xajax->configure("javascript URI","/swfupload/xajax/");

function registration

You can turn any xajax enabled function into an upload function by setting the mode to 'SWFupload':

$xajax->register(
	XAJAX_FUNCTION,
	"my_upload_function",
	array("mode" => "'SWFupload'", "SWFfield" => 'my_field_id',"SWFform" => 'my_form_id')
);

The "mode" is required to enable file uploading via SWF. Both other parameters are optional. When setting for instance "SWFfield" => 'field_id' it will only upload the file queue of the given field. The same applies for "SWFform" => 'my_form_id', with the exception that it will upload all queues from all file inputs inside the given form.

You can only set either SWFform or SWFfield. Without setting one of these values the function will upload all files from all queues!

To trigger the upload you only have to call the generated xajax function stub (xajax_ + function name). You can even pass additional values:

<input type="submit" value="upload" onclick"xajax_my_upload_function(xajax.getFormValues('my_form'),'foo','bar');" >

Javascript functions

The plugin provides two helper functions that will turn any file input fields into 'flash upload fields'.

  • xajax.ext.SWFupload.tools.transForm(form_id [String], config [optional Object], multiple [bool optional])
  • xajax.ext.SWFupload.tools.transField(element_id [String], config [optional Object]), multiple [bool optional])

xajax.ext.SWFupload.tools.transForm

This function parses the given form and replaces all file input fields inside the form.

 xajax.ext.SWFupload.tools.transForm('upload_form',{
		file_types : "*.jpg;*.gif", 
		file_types_description: "Web Image Files",
		file_size_limit : "3 MB"
 		},
 	true
 	);

xajax.ext.SWFupload.tools.transField

This function replaces the given input field.

 xajax.ext.SWFupload.tools.transField('upload_field_id',{
		file_types : "*.jpg;*.gif", 
		file_types_description: "Web Image Files",
		file_size_limit : "3 MB"
		},
	false
 	);

Both functions support passing an optional config object and the 'multiple' option.

Setting the multiple option to true enables selecting multiple files at once

The full reference for all configuration parameters can be found here: SWFUpload docs


xajax.ext.SWFupload.tools.destroyField

This function destroys the given input field and its associated objects.

xajax.ext.SWFupload.tools.destroyField(field_id);

xajax.ext.SWFupload.tools.destroyForm

This function destroys the all fields and its associated objects of the given form.

xajax.ext.SWFupload.tools.destroyForm(form_id);

response functions

All JavaScript functions are also available via xajax response commands.

  • $objResponse->clsSwfUpload->transForm($form_id,$config,$multiple)
  • $objResponse->clsSwfUpload->transField($form_id,$config,$multiple)
  • $objResponse->clsSwfUpload->destroyField($field_id)
  • $objResponse->clsSwfUpload->destroyForm($form_id)
  • $objResponse->clsSwfUpload->transForm('upload_form'
    	,array(
    		"file_types" => "*.jpg;*.gif;*.png;"
    		,"file_types_description" => "Image Files or mp3"
    		,"file_size_limit" => "5 MB"
    		,"upload_complete_handler" => "function () {
    		}"
    		,"post_params" => array(
    			"PHPSESSID" => session_id()
    		)
    	)
    	, true
    	);	
    

    Submitted by: Steffen Konerow on 2008-04-06 22:26:07
    E-mail: Steffen@nrg-media.de
    Web site: http://xajaxproject.org

Filed under: External Libraries > Response Commands

modalWindow

This Plugin allows you to add one or more Modal Windows in your web-application. You can use this to replace the javascript alert,confirm and prompt functions to design windows with more functionality and a smooth design.

Submitted by: Oliver Trebes on 2008-01-24 18:25:42
E-mail: info@angelmedia.de
Web site: http://www.angelmedia.de

Filed under: External Libraries > Response Commands, Javascript

[beta 1] Comet Streaming

This plugin allows to stream xajax response commands to the client using so called "comet streaming".

The zip file contains the latest xajax 0.5 SVN version.

Since the IE doesn't support multipart XHRs I had to create a fallback method using a hidden iframe (no polling!). Avoid streaming large amounts of data or LONG time streaming, since it will increase the memory usage in IE.

The setup is quite easy and should be self explanatory when you look into the comet.php file.

This plugin is now beta and not experimental anymore.
It supports FireFox 2, Safari 3, Opera 9 and IE6/7 only. Support for other browsers might follow soon. :)


Changelog 2008/02/23 beta 1 :

  • removed unnecessary request plugin (XAJAX_COMET)
  • supports normal xajax functions, callable objects,...
  • smaller JS code
  • better browser detection
  • improved XHR streaming
  • slightly improved PHP syntax

Please report ANY bugs either per e-mail or xajax forum.

Submitted by: Steffen Konerow on 2007-12-12 15:24:40
E-mail: Steffen@nrg-media.de
Web site: http://xajaxproject.org

Filed under: External Libraries > Response Commands, Javascript

jQuery plugin for xajax

I first want to start with saying that this isn't a plugin written by me. It is written by cyberlot but I use it and I find it very usefull so I wanted to post it here so that everybody can easelly find and use it. Maybe I expand the plugin in the future a bit so it can handle more then only the basic methods of jQuery. Basically the plugin enables access to all basic methods of jquery that can be called through direct methods The plugin will try to run any method you call, but does an error log on methods that are not put in validBaseMethods and therefore not "tested to work".

Submitted by: Ben Elsen on 2007-08-20 03:12:50
E-mail: benneke_10@hotmail.com
Web site: http://www.notyetready.be

thumbnail

Filed under: Standard Modules > Response Commands, Javascript

Backbutton handling based on RSH by Brad Neuberg

This plugin makes it possible to handle the browsers backbutton and provides a simple bookmarking functionality. It is based on Brad Neuberg's "Really Simple History". It works fine with IE and FF and should also work with Opera, Safari and other Webkit based browsers using the latest RSH Version.

Submitted by: ralf on 2007-04-27 17:18:29
E-mail: ralf@goldenzazu.de
Web site: http://code.goldenzazu.de


 

Got a plugin you'd like to share? Manage Your Plugins


SourceForge.net Logo