ysJQueryUIPlugin ================ The ysJQueryUIPlugin provides support for jQuery User Interface in your app views; Importing the jquery.ui library facilitating abstractions for low-level interaction and animation, advanced effects and high-level, themeable widgets, built on top of the jQuery JavaScript Library, that you can use to build highly interactive web applications. Everything from PHP code (Symfony helpers). jQuery and Symfony write less, do more. *Dependencies* -------------- * ysJQueryRevolutionsPlugins [Documentation](http://www.symfony-project.org/plugins/ysJQueryRevolutionsPlugin "ysJQueryRevolutionsPlugins") *Available Local Themes* ------------------------ * ui-lightness,blitzer,smoothness,cupertino **Tip:**: If you use only one, delete others. *Installation* -------------- * Install the plugin (from http://plugins.symfony-project.com) $ symfony plugin-install http://www.symfony-project.org/plugins/ysJQueryUIPlugin * Install the plugin (from .tgz file)
Download the .tgz from
http://www.symfony-project.org/plugins/ysJQueryUIPlugin
execute command:
php symfony plugin:install path/to/ysJQueryUIPlugin-.x.x.x.tgz * Enable modules in your `settings.yml` (optional for demos) [yml] all: .settings: enabled_modules: [default, jqueryui_demo] * Enable the plugin if necessary by editing config/ProjectConfiguration.class.php: [php] $this->enablePlugins('ysJQueryUIPlugin'); * Publish plugin assets (Very Important): php symfony plugin:publish-assets * Clear you cache symfony cc * See the app.yml to change where you load the library jquery.UI and themes (Optional). For localhost configuration is only available [ui-lightness,blitzer,smoothness,cupertino] themes. You can add or delete themes. [yml] all: .ys_jquery_ui_plugins: ###Core configuration--------------------------------------------------------- ### For load jquery.ui from ajax.googleapis.com: #ys_jquery_ui_web_dir: http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1 #default /ysJqueryUIPlugin #ys_jquery_ui_theme_dir: /themes #default /css/themes #ys_jquery_ui_js_dir: '' #default /js/jquery/ui ##ys_jquery_ui_theme: blitzer #default ui-lightness #ys_jquery_ui_i18n_dir: /i18n #default /i18n #ys_jquery_ui_theme_rolller: http://jqueryui.com/themeroller/themeswitchertool/ ###jquery.ui.core #ys_jquery_ui_core_js: [ jquery-ui.min.js ] #ys_jquery_ui_core_css: [ ui.all.css ] ### For load from jquery.ui localhost ys_jquery_ui_web_dir: /ysJQueryUIPlugin #default /ysJqueryUIPlugin ys_jquery_ui_theme_dir: /css/themes #default /css/themes ys_jquery_ui_js_dir: /js/jquery/ui #default /js/jquery/ui ys_jquery_ui_theme: redmond #default ui-lightness ys_jquery_ui_i18n_dir: i18n #default /i18n ys_jquery_ui_theme_rolller: /ysJQueryUIPlugin/js/jquery/themeswitchertool.js ###jquery.ui.core ys_jquery_ui_core_js: [ui.core.js] ys_jquery_ui_core_css: [jquery-ui-1.7.2.custom.css]
Helpers ------- * **ysJQueryRevolutionsHelper** Add this helper from ysJQueryRervoltionsPlugin (needed to work). Or **ysJQueryDollarRevolutionsHelper** * **ysJQueryUICoreHelper** Add this helper to create panels, buttons, links, icons with jqueryUI Styles. * **ysJQueryUIAccordionHelper** Add this helper to create jQueryUI accordions widgets. See the module: jqueryui_demo/accordion * **ysJQueryUIDatepickerHelper** Add this helper to create jQueryUI datepickers widgets. See the module: jqueryui_demo/datepicker * **ysJQueryUIDialogHelper** Add this helper to create jQueryUI dialog widgets. See the module: jqueryui_demo/dialog * **ysJQueryUIDraggableHelper** Add this helper to add jQueryUI draggable support. See the module: jqueryui_demo/draggable * **ysJQueryUIDroppableHelper** Add this helper to add jQueryUI droppable support. See the module: jqueryui_demo/droppable * **ysJQueryUIEffectsHelper** Add this helper to add jQueryUI effects support. See the module: jqueryui_demo/effects * **ysJQueryUIProgressbarHelper** Add this helper to create jQueryUI progressbar widgets. See the module: jqueryui_demo/progressbar * **ysJQueryUIResizableHelper** Add this helper to add jQueryUI resizable support. See the module: jqueryui_demo/resizable * **ysJQueryUISelectableHelper** Add this helper to add jQueryUI selectable support. See the module: jqueryui_demo/selectable * **ysJQueryUISliderHelper** Add this helper to create jQueryUI slider widgets. See the module: jqueryui_demo/slider * **ysJQueryUISortableHelper** Add this helper to add jQueryUI sortable support. See the module: jqueryui_demo/sortable * **ysJQueryUITabsHelper** Add this helper to create jQueryUI tabs widgets. See the module: jqueryui_demo/tabs * **ysJQueryUILayoutHelper** Add this helper to add jQueryUI Layout support. Change your layout.php by layout.php that is within the jqueryui_demo module to see how it works. **IMPORTANT**: If you use these helpers very often is advisable to add in the settings.yml [yml] all: .settings: standard_helpers: [Partial, Cache, Form, Javascript, ysJQueryRevolutions, ... , ysJQueryUICoreHelper]
*How To* -------- For _*_init_, _*_create_ and _*_suport_to_ helpers: Always the 1st argument is the jquery selector, the 2nd is the array configuration (optional), and the 3rd is html properties (optional) **Note**: You can define a listener in the configuration array. The listener must have the 'selector' and ('event' or 'oneEvent') indexes. You can add a behavior 'before' and 'after' executing the event: [php] array( 'listener' => array( 'selector' => '#jQuerySelector', //'event' => 'click', // To create the widget each time you run the event 'oneEvent' => 'click', // To create the widget only once you run the event 'after' => like_function("alert('After function')"), 'before' => like_function("alert('Before function')"), )) **Important**: 'oneEvent' takes precedence over 'event' option.
**WIDGETS:** * **Accordion**: [php] 'bounceslide', // <= animation requires bounce effect 'icons' => array( 'header' => 'ui-icon-plus' , 'headerSelected' => 'ui-icon-minus'), 'navigation' => false), 'class="myCustomClass" style=".myCustomStyle"') ?>Content 1
Content 2
* **Datepicker**: [php] 'button', 'buttonText' => 'Date', 'showMonthAfterYear' => false, 'i18n' => 'es'), 'class="myCustomClass" style=".myCustomStyle"') ?> true)) // <= in-line datepicker ?> You can use the helper **ui_datepicker_set_defaults()** to add default configuration to the datepicker.The array argument is the default configuration. If you dont pass the argument the helper look for the node 'ys_jquery_ui_datepicker_defaults' in the app.yml file [php] true, 'changeYear' => true, 'showMonthAfterYear' => false)) ?> ... [yml] all: .ys_jquery_ui_plugins: ys_jquery_ui_datepicker_defaults: changeMonth: true changeYear: true showMonthAfterYear: false **Note:** A bug in datepicker widgets is the z-index, sometimes not displayed. Solve it the following way: [css]
* **Dialog**: [php] 'Lorem ipsum', 'modal' => true, 'buttons' => array('Close' => like_function(ui_dialog_close('this'))), 'beforeclose' => like_function("alert('Before Close Dialog');")), 'class="myCustomClass" style=".myCustomStyle"') ?>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
* **Progressbar**: [php] 80 , 'change' => like_function("alert('Change Succesful')")), 'style="height:5px;width:50%"') ?> You can add animiation progress with the *ui_progressbar_init_animation_now()* or *ui_progressbar_animate()* helpers [php] // The 2nd argument is the duration //ui_progressbar_animate axample: array( 'selector' => '#btnBarListener', 'event' => 'click', 'before' => like_function(ui_progressbar_animate('#anotherProgressbarId' , 20))), 'value' => 80 , 'change' => like_function("alert('Change Succesful')"))) ?>
* **Slider**: [php] 50, 'change' => like_function('alert("Change Successful");'))); ?> You can add a value or multiple values and set the max and min value: [php] 80, 'min' => 15, 'values' => array(15,20,80))); ?> You can set horizontal or vertical orientation (default = 'horizontal') [php] 'vertical', 'value' => 25)); ?>
* **Tabs**: [php] array(2), 'sortable' => true, 'fx' => array('opacity' => 'toggle', 'duration' => 'slow'), 'unselect' => true, 'collapsible' => false))?>Tab 1 Content
Tab 2 Content
*INTERACTIONS:* * **Drag and Drop**: [php] true, 'cursor' => 'move', 'cursorAt' => array( 'top' => -12, 'left' => -20), 'helper' => 'clone', 'helperFunction' => like_function('return $(\' \')', 'event'))) ?> like_function("$(this).addClass('ui-state-highlight').find('p').html('Dropped!');"), 'deactivate' => like_function('alert("Deactivete successful")'), 'accept' => '#draggableSectionId', 'activeClass' => 'ui-state-active', 'addClasses' => true, 'greedy' => true, 'tolerance' => 'touch', 'hoverClass' => 'ui-state-hover')) ?>
* **Resizable**: [php] true, 'autoHide' => true)) ?> 'resizablePanelId', 'style' => 'width: 150px; height: 150px; padding: 0.5em;')) ?> 'center')) ?> Resizable PanelThis is the content
**Tip:** To create a resizable helper, add this css style: [css]
* **Selectable**: [php]
* **Sortable**: [php]
- Item 1-1
- Item 1-2
- Item 1-3
- Item 1-4
- Item 2-1
- (I'm not sortable or a drop target)
- (I'm not sortable or a drop target)
- Item 2-2
**Example**: [php]
* **add_core_hover_animation('jquery-selector', 'class1', 'class2')**
This helper adds a hover animation to matching elements with the jquery selector. The 2nd and 3rd arguments are optional and their respectively default values are 'ui-state-hover' , 'ui-state-active'
**Example**: [php]
* **Add Class**: [php] 'btnAddClassId','value' => 'Run Effect'))?> array( 'selector' => '#btnAddClassId', 'event'=> 'click' ), 'class' => 'ui-widget-content', 'duration' => 'slow' , 'callback' => like_function("alert('Class Added')"))) ?>
Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
* **Remove Class**: [php] 'btnRemoveClassId','value' => 'Run Effect'))?> array( 'selector' => '#btnRemoveClassId', 'event'=> 'click'), 'class' => 'ui-widget-content', 'duration' => 'slow' , 'callback' => like_function("alert('Class Removed')"))) ?>
* **Animate** Complex demo: [php] 'btnAnimate','value' => 'Run Effect'))?> array( 'backgroundColor' => '#aa0000', 'color' => '#fff', 'width' => 500), 'speed' => 1000))), like_function( jquery_execute_effect( '.divToAnimate', 'animate', array( 'options' => array( 'backgroundColor' => '#fff', 'color' => '#000', 'width' => 240), 'speed' => 1000))))))) ?>
Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
* **Effects**: [php] 'btnExecuteEffectId','value' => 'Run Effect'))?> array( 'selector' => '#btnExecuteEffectId', 'event'=> 'click'), 'effect' => 'highlight', 'speed' => 500, 'callback' => like_function("alert('Highlight Effect successful')")))?>
* **Hide**: [php] 'btnHideEffectId','value' => 'Run Effect'))?> array( 'selector' => '#btnHideEffectId', 'event'=> 'click'), 'effect' => 'clip', 'speed' => 'slow', 'callback' => like_function("alert('Hide effect successful')"))); ?>
* **Show**: [php] 'btnShowEffectId','value' => 'Run Effect'))?> array( 'selector' => '#btnShowEffectId', 'event'=> 'click'), 'effect' => 'blind', 'speed' => 'slow', 'callback' => like_function("alert('Show effect successful')"))) ?>
* **Switch Class**: [php] 'btnExecuteSwitchClassId','value' => 'Run Effect'))?> array( 'selector' => '#btnExecuteSwitchClassId', 'event'=> 'click'), 'remove' => 'ui-widget-content', 'add' => 'ui-widget-header', 'duration' => 'slow')) ?>
Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
* **Toggle**: [php] 'btnExecuteToggleEffectId','value' => 'Run Effect'))?> array( 'selector' => '#btnExecuteToggleEffectId', 'event'=> 'click'), 'effect' => 'explode', 'speed' => 'slow', 'callback' => like_function("alert('Toggle effect successful')"))) ?>
Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
* **Toggle Class**: [php] 'btnExecuteToggleClassId','value' => 'Run Effect'))?> array( 'selector' => '#btnExecuteToggleClassId', 'event'=> 'click'), 'class' => 'ui-widget-header', 'duration' => 'slow')) ?> *LAYOUT:* * Copy this code in your layout.php: [php]
This is the content panel
* **Link Button**: See the module: jqueryui_demo/buttons . [php] 'newwin', // ui-icon-