/[drupal]/contributions/modules/node_gallery/node_gallery.admin.js
ViewVC logotype

Contents of /contributions/modules/node_gallery/node_gallery.admin.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Mon Apr 27 19:22:29 2009 UTC (6 months, 4 weeks ago) by kmonty
Branch: MAIN
CVS Tags: DRUPAL-6--1-0-ALPHA8, HEAD
Branch point for: DRUPAL-6--2, DRUPAL-6--1
Changes since 1.1: +66 -3 lines
File MIME type: text/javascript
* Significantly improved options for display teasers and gallery landing pages
in the administration menu.
* Lightbox2 gallery support both from teasers and gallery landing pages.
1 // $Id: node_gallery.admin.js,v 1.1 2009/04/26 02:45:19 kmonty Exp $
2
3 $(document).ready(function(){
4 // View Original as Lightbox2 Popup
5 $lightbox2_input = $('input#edit-data-view-original-lightbox2');
6 $lightbox2_preset = $('.lightbox2-preset');
7
8 // View original as text link
9 $view_original_text = $('input#edit-data-view-original-text');
10 $view_original_text_value = $('.view-original-text-value');
11 $view_original_radios = $('.view-original-radios input:radio');
12
13 // View thumbnail information
14 $thumbnail_number = $('#edit-data-teaser-thumbnails-num-wrapper');
15 $thumbnail_radio = $('input#edit-data-teaser-gallery-display-type-thumbnails');
16 $teaser_view_radios = $('.teaser-display-type-radios input:radio');
17 $thumbnail_lightbox2 = $('input#edit-data-teaser-gallery-display-type-lightbox2-gallery');
18 $thumbnail_lightbox2_preset = $('.lightbox2-gallery-preset');
19
20 // View Gallery information
21 $gallery_display_radios = $('.gallery-display-type-radios');
22 $gallery_display_lightbox2 = $('input#edit-data-gallery-gallery-display-lightbox2-gallery');
23 $gallery_display_lightbox2_preset = $('.gallery-lightbox2-gallery-preset');
24
25 // Onload - If Lightbox is not selected, hide the imagecache preset field
26 if ($lightbox2_input.attr('checked') == false) {
27 $lightbox2_preset.hide();
28 }
29
30 // Onload - If text is not selected, hide the textfield
31 if ($view_original_text.attr('checked') == false) {
32 $view_original_text_value.hide();
33 }
34
35 // Onload - If teaser display "thumbnail" is not selected,
36 // hide the textfield
37 if ($thumbnail_radio.attr('checked') == false) {
38 $thumbnail_number.hide();
39 }
40
41 // Onload - If teaser display "lightbox" is not selected,
42 // hide the preset selection
43 if ($thumbnail_lightbox2.attr('checked') == false) {
44 $thumbnail_lightbox2_preset.hide();
45 }
46
47 // Onload - If gallery display "lightbox" is not selected,
48 // hide the preset selection
49 if ($gallery_display_lightbox2.attr('checked') == false) {
50 $gallery_display_lightbox2_preset.hide();
51 }
52
53 // If the radios have changed, we will want evaluate to see if we want to
54 // show or hide some extra fields
55 $view_original_radios.change(function () {
56 if ($lightbox2_input.attr('checked')) {
57 $lightbox2_preset.slideDown();
58 }
59 else {
60 $lightbox2_preset.slideUp();
61 }
62
63 if ($view_original_text.attr('checked')) {
64 $view_original_text_value.slideDown();
65 }
66 else {
67 $view_original_text_value.slideUp();
68 }
69 });
70
71 // If the teaser display radios have changed, we will want evaluate to see
72 // if we want to show or hide some extra fields
73 $teaser_view_radios.change(function () {
74 if ($thumbnail_radio.attr('checked')) {
75 $thumbnail_number.slideDown();
76 }
77 else {
78 $thumbnail_number.slideUp();
79 }
80
81 if ($thumbnail_lightbox2.attr('checked')) {
82 $thumbnail_lightbox2_preset.slideDown();
83 }
84 else {
85 $thumbnail_lightbox2_preset.slideUp();
86 }
87 });
88
89 // If the gallery display radios have changed, we will want evaluate to see
90 // if we want to show or hide some extra fields
91 $gallery_display_radios.change(function () {
92 if ($gallery_display_lightbox2.attr('checked')) {
93 $gallery_display_lightbox2_preset.slideDown();
94 }
95 else {
96 $gallery_display_lightbox2_preset.slideUp();
97 }
98 });
99 });

  ViewVC Help
Powered by ViewVC 1.1.2