Exemplo n.º 1
0
    function test_sortable_element()
    {
        $result = ScriptaculousHelper::sortable_element('list', array('url' => '/', 'containment' => array('left', 'right'), 'only' => 'middle'));
        $expected = <<<SCRIPT
<script type="text/javascript">
//<![CDATA[
Sortable.create('list', {containment:['left','right'], onUpdate:function(){new Ajax.Request('/', {asynchronous:true, evalScripts:false, parameters:Sortable.serialize('list')})}, only:'middle'})
//]]>
</script>
SCRIPT;
        $this->assertEqual($result, $expected);
    }
Exemplo n.º 2
0
 /**
  * Starts a script.aculo.us visual effect. See
  * ScriptaculousHelper for more information.
  *
  * @param type <description>
  * @param type <description>
  * @param type <description>
  *
  * @return void
  */
 function visual_effect($name, $id = FALSE, $js_opt = array())
 {
     $this->record(ScriptaculousHelper::visual_effect($name, $id, $js_opt));
 }
Exemplo n.º 3
0
 /**
  * Makes the element with the DOM ID specified by +element_id+ draggable.
  *
  * Example:
  *   <?= draggable_element("my_image", 'revert' => true)
  * 
  * You can change the behaviour with various options, see
  * http://script.aculo.us for more documentation. 
  */
 function draggable_element($element_id, $options = array())
 {
     return JavascriptHelper::javascript_tag(ScriptaculousHelper::draggable_element_js($element_id, $options));
 }