-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
1234 lines (980 loc) · 40.9 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
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)<br>
Download the .tgz from <br>
http://www.symfony-project.org/plugins/ysJQueryUIPlugin<br>
execute command:<br>
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]
<br><br>
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]
<br><br>
*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.
<br><br>
**WIDGETS:**
* **Accordion**:
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_helper('ysJQueryUIAccordion') ?>
<?php ui_add_effects_support('bounce') // support for bounce effect ?>
<?php ui_accordion_init(
'accordionId',
array(
'animated' => 'bounceslide', // <= animation requires bounce effect
'icons' => array(
'header' => 'ui-icon-plus' ,
'headerSelected' => 'ui-icon-minus'),
'navigation' => false),
'class="myCustomClass" style=".myCustomStyle"') ?>
<?php ui_accordion_init_section('Section 1', 'id="section1"') ?>
<p> Content 1 </p>
<?php ui_accordion_end_section() ?>
<?php ui_accordion_init_section('Section 2', 'id="section2"') ?>
<p> Content 2 </p>
<?php ui_accordion_end_section() ?>
<?php ui_accordion_end() ?>
<br><br>
* **Datepicker**:
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_helper('ysJQueryUIDatepicker') ?>
<?php ui_datepicker_create(
'datepickerId',
array(
'showOn' => 'button',
'buttonText' => 'Date',
'showMonthAfterYear' => false,
'i18n' => 'es'),
'class="myCustomClass" style=".myCustomStyle"') ?>
<?php ui_datepicker_create(
'anotherDatepickerId',
array(
'inLine' => 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]
<?php echo ui_datepicker_set_defaults(
array(
'changeMonth' => true,
'changeYear' => true,
'showMonthAfterYear' => false)) ?>
<?php echo ui_datepicker_set_defaults() // Search in the app.yml ?>
...
[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]
<style type="text/css">
.ui-datepicker { z-index: 2000; } /* or more */
</style>
<br><br>
* **Dialog**:
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_helper('ysJQueryUIDialog') ?>
<?php ui_dialog_init(
'dialogId' ,
array(
'title' => 'Lorem ipsum',
'modal' => true,
'buttons' => array('Close' => like_function(ui_dialog_close('this'))),
'beforeclose' => like_function("alert('Before Close Dialog');")),
'class="myCustomClass" style=".myCustomStyle"') ?>
<p align="justify">
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
</p>
<?php ui_dialog_end() ?>
<br><br>
* **Progressbar**:
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_stylesheet('/ysJqueryUIPlugin/demos.css') ?>
<?php ui_progressbar_create(
'progressbarId' ,
array(
'value' => 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]
<?php echo ui_progressbar_init_animation_now('#progressbarId' , 20) ?>
// The 2nd argument is the duration
//ui_progressbar_animate axample:
<?php ui_progressbar_create(
'anotherProgressbarId' ,
array(
'listener' => array(
'selector' => '#btnBarListener',
'event' => 'click',
'before' => like_function(ui_progressbar_animate('#anotherProgressbarId' , 20))),
'value' => 80 ,
'change' => like_function("alert('Change Succesful')"))) ?>
<input value="Create Progressbar" type="button" id="btnBarListener" />
<br><br>
* **Slider**:
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_helper('ysJQueryUISlider') ?>
<?php ui_slider_create(
'sliderId',
array(
'value' => 50,
'change' => like_function('alert("Change Successful");'))); ?>
You can add a value or multiple values and set the max and min value:
[php]
<?php ui_slider_create(
'anotherSliderId',
array(
'max' => 80,
'min' => 15,
'values' => array(15,20,80))); ?>
You can set horizontal or vertical orientation (default = 'horizontal')
[php]
<?php ui_slider_create(
'veticalSliderId',
array(
'orientation' => 'vertical',
'value' => 25)); ?>
<br><br>
* **Tabs**:
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_helper('ysJQueryUITabs') ?>
<?php ui_tabs_init_panel(
'tabPanelId',
array(
'disabled' => array(2),
'sortable' => true,
'fx' => array('opacity' => 'toggle',
'duration' => 'slow'),
'unselect' => true,
'collapsible' => false))?>
<?php ui_tabs_init()?>
<?php ui_tab('myTab1', 'Tab 1 Title')?>
<?php ui_tab('myTab2', 'Tab 2 Title')?>
<?php ui_tab(url_for('jqueryui_demo/accordion'), 'Remote' , true)?>
<?php ui_tabs_end()?>
<?php ui_tabs_init_content_for('myTab1')?>
<p>
Tab 1 Content
</p>
<?php ui_tabs_end_content()?>
<?php ui_tabs_init_content_for('myTab2')?>
<p>
Tab 2 Content
</p>
<?php ui_tabs_end_content()?>
<?php ui_tabs_end_panel() ?>
*INTERACTIONS:*
* **Drag and Drop**:
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_helper('ysJQueryUIDraggable') ?>
<?php use_helper('ysJQueryUIDroppable') ?>
<?php ui_draggable_support_to(
'#draggableSectionId' ,
array(
'revert' => true,
'cursor' => 'move',
'cursorAt' => array(
'top' => -12,
'left' => -20),
'helper' => 'clone',
'helperFunction' => like_function('return $(\'<div class="ui-widget-header">I"m a helper</div>\')', 'event'))) ?>
<div id="draggableSectionId"
class="ui-widget-content"
style="width: 100px; height: 100px; padding: 0.5em; float: left; margin: 10px 10px 10px 0;">
<p>Draggable</p>
</div>
<?php ui_droppable_support_to(
'#droppableSectionId',
array(
'drop' => 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')) ?>
<div id="droppableSectionId"
class="ui-widget-header"
style="width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px;">
<p>Drop here</p>
</div>
<br><br>
* **Resizable**:
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_helper('ysJQueryUIResizable') ?>
<?php ui_resizable_support_to(
'#resizablePanelId',
array(
'animate' => true,
'autoHide' => true)) ?>
<?php echo ui_init_content_panel(
array(
'id' => 'resizablePanelId',
'style' => 'width: 150px; height: 150px; padding: 0.5em;')) ?>
<?php echo ui_init_title(array('textAlign' => 'center')) ?>
Resizable Panel
<?php echo ui_end_title() ?>
<p>This is the content</p>
<?php echo ui_end_content_panel() ?>
**Tip:** To create a resizable helper, add this css style:
[css]
<style type="text/css">
.ui-resizable-helper { border: 1px dotted gray; }
</style>
<br><br>
* **Selectable**:
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_helper('ysJQueryUISelectable') ?>
<style type="text/css">
.ui-selectable .ui-selecting { background: #FECA40; }
.ui-selectable .ui-selected { background: #F39814; color: white; }
.ui-selectable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
.ui-selectable li { margin: 3px; padding: 0.4em; font-size: 1.4em; height: 18px; }
</style>
<ol id="selectableSectionId">
<li class="ui-widget-content">Item 1</li>
<li class="ui-widget-content">Item 2</li>
<li class="ui-widget-content">Item 3</li>
<li class="ui-widget-content">Item 4</li>
<li class="ui-widget-content">Item 5</li>
<li class="ui-widget-content">Item 6</li>
</ol>
<?php ui_selectable_support_to('#selectableSectionId') ?>
<?php echo ui_disable_selection('#selectableSectionId li') //Disable selection in the list ?>
<br><br>
* **Sortable**:
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_helper('ysJQueryUISortable') ?>
<style type="text/css">
#sortableId1 , #sortableId2 { list-style-type: none; margin: 0; padding: 0; zoom: 1; }
#sortableId1 li , #sortableId2 li{ margin: 0 5px 5px 5px; padding: 3px; width: 90%; }
</style>
<ul id="sortableId1">
<li class="ui-state-default">Item 1-1</li>
<li class="ui-state-default">Item 1-2</li>
<li class="ui-state-default">Item 1-3</li>
<li class="ui-state-default">Item 1-4</li>
</ul>
<ul id="sortableId2">
<li class="ui-state-default">Item 2-1</li>
<li class="ui-state-default ui-state-disabled">(I'm not sortable or a drop target)</li>
<li class="ui-state-default ui-state-disabled">(I'm not sortable or a drop target)</li>
<li class="ui-state-default">Item 2-2</li>
</ul>
<?php ui_sortable_support_to(
'#sortableId1, #sortableId2',
array(
'items' => 'li:not(.ui-state-disabled)'))?>
<?php echo ui_disable_selection('#sortableId1 li, #sortableId2 li') //Disable selection in the list ?>
*EFFECTS:*
* **ui_add_effects_support('effect' or array('effect1', 'effect2'))**
Add the javascript files for the effect support.
<br>
**Example**:
[php]
<?php ui_add_effects_support('bounce') ?>
<?php ui_add_effects_support(array('bounce' , 'slide')) ?>
<br>
* **add_core_hover_animation('jquery-selector', 'class1', 'class2')**
<br>
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'
<br>
**Example**:
[php]
<?php echo ui_core_hover_animation_to('input:button')?>
<?php echo ui_core_hover_animation_to('input:button', 'myCustonHoverClass', 'myCustomActiveClass') ?>
<br><br>
* **Add Class**:
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_helper('ysJQueryUIEffects') ?>
<?php echo ui_link_button(array('id' => 'btnAddClassId','value' => 'Run Effect'))?>
<?php echo ui_effects_add_class(
'#sectionToAddClassId',
array(
'listener' => array(
'selector' => '#btnAddClassId',
'event'=> 'click' ),
'class' => 'ui-widget-content',
'duration' => 'slow' ,
'callback' => like_function("alert('Class Added')"))) ?>
<div id="sectionToAddClassId" style="width:250px">
<br>
<p>Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
</p>
<br>
</div>
<br><br>
* **Remove Class**:
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_helper('ysJQueryUIEffects') ?>
<?php echo ui_link_button(array('id' => 'btnRemoveClassId','value' => 'Run Effect'))?>
<?php echo ui_effects_remove_class(
'#sectionToRemoveClassId',
array(
'listener' => array(
'selector' => '#btnRemoveClassId',
'event'=> 'click'),
'class' => 'ui-widget-content',
'duration' => 'slow' ,
'callback' => like_function("alert('Class Removed')"))) ?>
<div id="sectionToRemoveClassId" class="ui-widget-content" style="width:250px">
<br>
<p>Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
</p>
<br>
</div>
<br><br>
* **Animate** Complex demo:
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_helper('ysJQueryUIEffects') ?>
<?php echo ui_link_button(array('id' => 'btnAnimate','value' => 'Run Effect'))?>
<?php echo add_jquery_support(
'document',
'ready' ,
like_function(
jquery_toggle_event(
'#btnAnimate',
array(
like_function(
jquery_execute_effect(
'.divToAnimate',
'animate',
array(
'options' => 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))))))) ?>
<div class="divToAnimate" style="width:250px">
<br>
<p>Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
</p>
<br>
</div>
<br><br>
* **Effects**:
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_helper('ysJQueryUIEffects') ?>
<?php echo ui_link_button(array('id' => 'btnExecuteEffectId','value' => 'Run Effect'))?>
<?php echo ui_effects(
'#divEffectId',
array(
'listener' => array(
'selector' => '#btnExecuteEffectId',
'event'=> 'click'),
'effect' => 'highlight',
'speed' => 500,
'callback' => like_function("alert('Highlight Effect successful')")))?>
<div id="divEffectId" class="ui-widget-content" style="width:250px">
<br>
<p>Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
</p>
<br>
</div>
<br><br>
* **Hide**:
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_helper('ysJQueryUIEffects') ?>
<?php echo ui_link_button(array('id' => 'btnHideEffectId','value' => 'Run Effect'))?>
<?php echo ui_effects_hide(
'#divEffectId',
array(
'listener' => array(
'selector' => '#btnHideEffectId',
'event'=> 'click'),
'effect' => 'clip',
'speed' => 'slow',
'callback' => like_function("alert('Hide effect successful')"))); ?>
<div id="divEffectId" class="ui-widget-content" style="width:250px">
<br>
<p>Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
</p>
<br>
</div>
<br><br>
* **Show**:
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_helper('ysJQueryUIEffects') ?>
<?php echo ui_link_button(array('id' => 'btnShowEffectId','value' => 'Run Effect'))?>
<?php echo ui_effects_show(
'#divEffectId',
array(
'listener' => array(
'selector' => '#btnShowEffectId',
'event'=> 'click'),
'effect' => 'blind',
'speed' => 'slow',
'callback' => like_function("alert('Show effect successful')"))) ?>
<div id="divEffectId" class="ui-widget-content" style="width:250px">
<br>
<p>Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
</p>
<br>
</div>
<br><br>
* **Switch Class**:
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_helper('ysJQueryUIEffects') ?>
<?php echo ui_link_button(array('id' => 'btnExecuteSwitchClassId','value' => 'Run Effect'))?>
<?php echo ui_effects_switch_class(
'#divSwitchClassId',
array(
'listener' => array(
'selector' => '#btnExecuteSwitchClassId',
'event'=> 'click'),
'remove' => 'ui-widget-content',
'add' => 'ui-widget-header',
'duration' => 'slow')) ?>
<div id="divSwitchClassId" style="width:250px">
<br>
<p>Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
</p>
<br>
</div>
<br><br>
* **Toggle**:
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_helper('ysJQueryUIEffects') ?>
<?php echo ui_link_button(array('id' => 'btnExecuteToggleEffectId','value' => 'Run Effect'))?>
<?php echo ui_effects_toggle(
'#divToggleEffectId',
array(
'listener' => array(
'selector' => '#btnExecuteToggleEffectId',
'event'=> 'click'),
'effect' => 'explode',
'speed' => 'slow',
'callback' => like_function("alert('Toggle effect successful')"))) ?>
<div id="divToggleEffectId" style="width:250px">
<br>
<p>Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
</p>
<br>
</div>
<br><br>
* **Toggle Class**:
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_helper('ysJQueryUIEffects') ?>
<?php echo ui_link_button(array('id' => 'btnExecuteToggleClassId','value' => 'Run Effect'))?>
<?php echo ui_effects_toggle_class(
'#divToggleClassId',
array(
'listener' => array(
'selector' => '#btnExecuteToggleClassId',
'event'=> 'click'),
'class' => 'ui-widget-header',
'duration' => 'slow')) ?>
<div id="divToggleClassId" class="ui-widget-content" style="width:250px">
<br>
<p>Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
</p>
<br>
</div>
*LAYOUT:*
* Copy this code in your layout.php:
[php]
<?php use_helper('ysJQueryUILayout'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<?php include_http_metas() ?>
<?php include_metas() ?>
<?php include_title() ?>
<link rel="shortcut icon" href="/favicon.ico" />
<?php include_stylesheets() ?>
<?php include_javascripts() ?>
<?php ui_layout_configure_to(
'layoutVarName',
'body') ?>
</head>
<body>
<div class="ui-layout-center">
<?php echo $sf_content ?>
<?php //echo $sf_data->getRaw('sf_content') // for symfony 1.0?>
</div>
<div class="ui-layout-north">
<span style="font-size:12px;">
TIP: Using an IFRAME as a pane works great! Since the iframe auto-sizes,
you will never again have TWO vertical scrollbars on your page.
</span>
</div>
<div class="ui-layout-south">
<span style="font-size:12px;">South Content</span>
</div>
<div class="ui-layout-east">
<span style="font-size:12px;">East Content</span>
</div>
<div class="ui-layout-west">
<span style="font-size:12px;">West Content</span>
</div>
</body>
</html>
In the module 'jqueryui_demo' you can see a complex layout.php example.
*MORE:*
* **Panels**: See the module: jqueryui_demo/panel .
[php]
<?php use_helper('ysJQueryRevolutions') ?>
<?php use_helper('ysJQueryUICore') ?>
<?php echo ui_init_content_panel()?>
<?php echo ui_init_title(
array(
'icon' => 'newwin' ,
'style' => 'cursor:pointer')) ?>
This is the title
<?php echo ui_end_title() ?>
<?php echo ui_init_content()?>
<p>This is the content panel</p>
<?php echo ui_end_content()?>
<?php echo ui_end_content_panel()?>
* **Link Button**: See the module: jqueryui_demo/buttons .
[php]
<?php use_helper('ysJQueryRevolutions')?>
<?php use_helper('ysJQueryUICore')?>
<?php echo add_jquery_support('#lnkBtnId', 'click', like_function('alert("test")'))?>
<?php echo ui_link_button(
array(
'icon' => 'newwin', // ui-icon-<newwin>
'align' => 'right', // (left| rigth)
'title' => 'My Title',
//'noTitle' => true, // (<false> | true)
'corner' => 'left', // (<all> |left| rigth)
'state' => 'disabled', // (<enable> | disabled)
'target' => '_blank', // (<_self> | frame id | _blank, _top, _parent)
'priority' => 'secondary', // (<primary> | secondary )
'show' => true, // (<true> | false)
'url' => url_for('http://www.google.com'),
'value' => 'Link button',
'id' => 'lnkBtnId')); ?>
* **Button**: See the module: jqueryui_demo/buttons .
[php]
<?php use_helper('ysJQueryRevolutions')?>
<?php use_helper('ysJQueryUICore')?>
<?php echo ui_button(
array(
'title' => 'My Title',
//'noTitle' => true, // (<false> | true)
'corner' => 'left', // (<all> |left| rigth)
'state' => 'disabled', // (<enable> | disabled)
'priority' => 'secondary', // (<primary> | secondary )
'show' => true, // (<true> | false)
'value' => 'Link button',
'id' => 'btnId')); ?>
* **Button Pane**: See the module: jqueryui_demo/buttons .
[php]
<?php use_helper('ysJQueryRevolutions')?>
<?php use_helper('ysJQueryUICore')?>
<?php echo ui_button_pane_init(
$type = 'single',
array(
'idBtn1' => array(
'value' => 'Hello',
'icon' => 'newwin'),
'idBtn2' => array(
'value' => 'World',
'icon' => 'newwin')))?>
<?php echo ui_button_pane_end() ?>
<?php echo ui_button_pane_init(
$type = 'multiple',
array(
'idBtn3' => array(
'title' => 'B',
'value' => '<b>B</b>'),
'idBtn4' => array(
'title' => 'I',
'value' => '<i>I</i>'),
'idBtn5' => array(
'title' => 'U',
'value' => '<u>U</u>')))?>
<?php echo ui_button_pane_end() ?>
* **UI Table**: See the module: jqueryui_demo/buttons .
[php]
<?php use_helper('ysJQueryRevolutions')?>
<?php use_helper('ysJQueryUICore')?>
<?php ui_grid_init('jQuery UI Grid Header') ?>
<?php ui_grid_head_init() ?>
<?php ui_grid_th('<a>First</a>', 'colspan="2"') ?>
<?php ui_grid_th('<a>Second</a>') ?>
<?php ui_grid_th('<a>Third</a>') ?>
<?php ui_grid_head_end() ?>
<?php ui_grid_body_init() ?>
<?php for($i=0;$i<=10;$i++): ?>
<?php ui_grid_tr_init() ?>
<?php for($j=0;$j<=3;$j++): ?>
<?php ui_grid_td_init() ?>
<?php echo sprintf('Value %s-%s',$i,$j) ?>
<?php ui_grid_td_end() ?>
<?php endfor; ?>
<?php ui_grid_tr_end() ?>
<?php endfor; ?>
<?php ui_grid_body_end() ?>
<?php ui_grid_foot_init() ?>
<div class="ui-grid-paging ui-helper-clearfix">
<a href="#" class="ui-grid-paging-prev ui-state-default ui-corner-left"><span class="ui-icon ui-icon-triangle-1-w" title="previous set of results"></span></a>
<a href="#" class="ui-grid-paging-next ui-state-default ui-corner-right"><span class="ui-icon ui-icon-triangle-1-e" title="next set of results"></span></a>
</div>
<div class="ui-grid-results">Showing results ???</div>
<?php ui_grid_foot_end() ?>.
<?php ui_grid_end() ?>
* **Themeroller Tool**: See the layout.php. You can use it to show customers the differents styles for the application
[php]
<?php use_helper('ysJQueryRevolutions')?>
<?php use_helper('ysJQueryUICore')?>
<?php echo ui_theme_switcher_tool(
'themeroller',
array(
'width' => 200,
'buttonPreText' => 'ysJQueryUIPlugin: ')) ?>
More documentation and examples in the module 'jqueryui_demo'
*How to change the jQueryUI Theme*
----------------------------------
If you configuration in app.yml is 'ajax.googleapis.com' go to step 6
1. Go to jqueryui.com themeroller web site [Here](http://jqueryui.com/themeroller/ "jqueryui.com").