Ñò e>õGc @s¹dZddkTddklZlZddklZlZddklZd„Z e d„Z d„Z d „Z d „Zd „Zd „Zd „Zd„ZdddddgZdS(sî Scriptaculous Helpers Provides a set of helpers for calling Scriptaculous JavaScript functions, including those which create AJAX controls and visual effects. To be able to use these helpers, you must include the Prototype JavaScript framework and the Scriptaculous JavaScript library in your pages. The Scriptaculous helpers' behavior can be tweaked with various options. See the documentation at http://script.aculo.us for more information on using these helpers in your application. iÿÿÿÿ(t*(toptions_for_javascripttarray_or_string_for_javascript(t AJAX_OPTIONStjavascript_tag(tcamelizecCsdt|tƒo d|St|tƒo7ddig}|D]}|t|ƒq=~ƒdSdS(Ns'%s't[t,t](t isinstancetstrtlisttjoint_elements_to_js(telementst_[1]te((sB/usr/lib/python2.6/site-packages/webhelpers/rails/scriptaculous.pyR s c Ks|o t|ƒpd}t|idƒtƒohddig}|diƒD]5\}}|d||djo|pd|fqQ~ƒ|d If no element_id is given, it assumes "element" which should be a local variable in the generated JavaScript execution context. This can be used for example with drop_receiving_element:: <% drop_receving_element('some_element', loading=visual_effect('fade')) %> This would fade the element that was dropped on the drop receiving element. For toggling visual effects, you can use ``toggle_appear``, ``toggle_slide``, and ``toggle_blind`` which will alternate between appear/fade, slidedown/slideup, and blinddown/blindup respectively. You can change the behaviour with various options, see http://script.aculo.us for more documentation. telementtqueues{%s}Rs%s:%stlimits'%s'ttogglesEffect.toggle(%s,'%s',%s);ttoggle_tsnew Effect.%s(%s,%s);( R R tgettdictR t iteritemsthas_keytreplaceRR(tnamet element_idt js_optionsRRtktv((sB/usr/lib/python2.6/site-packages/webhelpers/rails/scriptaculous.pyt visual_effects X $cOsKg}|D]}|||idƒ q ~}ddi|ƒt|ƒfS(sÛ Wrap visual effects so they occur in parallel. Example:: parallel_effects( visual_effect('highlight, 'dom_id'), visual_effect('fade', 'dom_id'), ) t;snew Effect.Parallel([%s], %s)R(trindexR R(teffectsRRRt str_effects((sB/usr/lib/python2.6/site-packages/webhelpers/rails/scriptaculous.pytparallel_effectsEs .cKstt||ƒS(sÌ Make the element with the DOM ID specified by ``element_id`` sortable. Uses drag-and-drop and makes an Ajax call whenever the sort order has changed. By default, the action called gets the serialized sortable element as parameters. Example:: <% sortable_element("my_list", url=url(action="order")) %> In the example, the server-side action gets a "my_list" array parameter containing the values of the ids of elements the sortable consists of, in the current order (like ``mylist=item1&mylist=item2``, where ``item1`` and ``item2`` are the ids of the ``
  • `` elements). Note: For this to work, the sortable elements must have id attributes in the form ``string_identifier``. For example, ``item_1``. Only the identifier part of the id attribute will be serialized. You can change the behaviour with various options, see http://script.aculo.us for more documentation. (Rtsortable_element_js(Rtoptions((sB/usr/lib/python2.6/site-packages/webhelpers/rails/scriptaculous.pytsortable_elementTscKs5t|tƒptdƒ‚n|idd|ƒ|iddt|ƒx,|iƒD]}|tjo ||=q[q[WxKdddd gD]7}|i|ƒo!||od |||| You can change the behaviour with various options, see http://script.aculo.us for more documentation. (Rtdrop_receiving_element_js(RR(((sB/usr/lib/python2.6/site-packages/webhelpers/rails/scriptaculous.pytdrop_receiving_element•scKsÁ|iddƒ|iddt|ƒx,|iƒD]}|tjo ||=q7q7W|idƒot|dƒ|ds   )