/*
+--------------------------------------------------------------------------
| jQuery simTaco plugin - A port of jQuery Taconite plugin by M. Alsup
| http://malsup.com/jquery/taconite/
|
| There are two important differences!
| 1. simTaco can send unlimited options to the server - must be defined as JSON
| 2. simTaco works onDemand (bind) and not by listener - that caused issues with other scripts in my work
|
| Additionally and most important, simTaco works with latest jQuery - tested up to v1.7.1
|
| simTaco allowes the fast developpment of extended user interfaces, like for example the one from Facebook.
| Multiple DOM updates, content changes and style changes can be
| performed by a single AJAX call. This call can transmit as many variables as needed!
| The server responds with an XML file, that holds all changes intended.
|
| ========================================
| simTaco Copyright (c) 2012 by Hensel Hartmann
| http://www.simpeligent.ch
| ========================================
| simTaco is Dual licensed under the MIT and GPL licenses:
| http://www.opensource.org/licenses/mit-license.php
| http://www.gnu.org/licenses/gpl.html
|
+--------------------------------------------------------------------------
*/
**********************************
HTML to call a simTaco xml:
**********************************
<span class="someElement" simTaco_path="simTaco_controller.php" simTaco_options='{"page":"main","id":"1","foo":"bar","anyOption":"you like"}' >simTaco-Link</span>
simTaco_path is optional - it can aswell be defined centralized for all elements (see below)
simTaco_options must be valid JSON - it can be as long as you like and can also be defined elsewhere (see below)
**********************************
**********************************
Simple JS to call all simTaco xml:
**********************************
simTaco does use cachebusting code - each call is a fresh one.
<script>
$('.someElement').live('click', function() {
var element = this;
var p = jQuery(element).attr('simTaco_path');
if(!p){ p = 'simTaco_controller_default.php';}
var s = jQuery(element).attr('simTaco_options');
$().simTaco({
'simTacoDebug' : 1, // set to one to get debug info in Firebug
'path' : p, // the server side file, that responds with valid XML
'options' : s // options as JSON
});
});
</script>
**********************************
**********************************
Some examples:
**********************************
you can find more on the taconite site
http://malsup.com/jquery/taconite/
<!-- no-arg commands -->
<remove select="#result2" />
<hide select="#result" />
<!-- one-arg command -->
<addClass select="#result" arg1="special" />
<slideUp select="#result" arg1="slow" />
<slideDown select="#result" arg1="slow" />
<!-- two-arg command -->
<attr select="#result" arg1="title" arg2="My Title" />
<css select="div" arg1="width" arg2="500px" />
One Special Command: |eval|
<eval>
$('#result').html("This text came from an eval command!");
</eval>
Note: The JavaScript should be inside a CDATA block if it contains
special characters like |<| or |&|.
<eval>
<![CDATA[
$('#result').html("<strong>An error has occurred!</strong>");
]]>
</eval>
<after select="#result">
This text will go AFTER the result div.
</after>
<before select="#result">
<div>This div will go BEFORE the result div.</div>
</before>
<wrap select="#result span">
<span style="border: 1px dashed #00F"></span>
</wrap>
<append select="#result">
<div>This div is APPENDED</div>
</append>
**********************************
|