Index: trunk/extensions/PageSchemas/specials/PS_EditSchema.php |
— | — | @@ -45,9 +45,6 @@ |
46 | 46 | }); |
47 | 47 | jQuery('#templatesList').append(newField); |
48 | 48 | } |
49 | | -function clickcheckbox(form){ |
50 | | -alert('Handler for .change() uncalled.'); |
51 | | -} |
52 | 49 | |
53 | 50 | jQuery(document).ready(function() { |
54 | 51 | jQuery(".deleteField").click( function() { |
— | — | @@ -59,7 +56,16 @@ |
60 | 57 | // Remove the encompassing div for this instance. |
61 | 58 | jQuery(this).closest(".templateBox") |
62 | 59 | .fadeOut('fast', function() { jQuery(this).remove(); }); |
63 | | - }); |
| 60 | + }); |
| 61 | + jQuery('.isListCheckbox').click(function() { |
| 62 | + if (jQuery(this).is(":checked")) |
| 63 | + { |
| 64 | + jQuery(this).siblings('.delimiterInput').css('display', ''); |
| 65 | + }else{ |
| 66 | + jQuery(this).siblings('.delimiterInput').css('display', 'none'); |
| 67 | + } |
| 68 | + }); |
| 69 | + |
64 | 70 | }); |
65 | 71 | |
66 | 72 | </script> |
— | — | @@ -67,18 +73,7 @@ |
68 | 74 | END; |
69 | 75 | $wgOut->addScript( $jsText ); |
70 | 76 | } |
71 | | -/* |
72 | | -@TODO :Code which can be useful |
73 | | -jQuery("#is_list_1").click(function() { |
74 | | - if (jQuery("#is_list_1").is(":checked")) |
75 | | - { |
76 | | - alert('Handler for .change() called.'); |
77 | | - }else{ |
78 | | - alert('Handler for .change() uncalled.'); |
79 | | - } |
80 | | - }); |
81 | | -*/ |
82 | | - function execute( $category ) { |
| 77 | + function execute( $category ) { |
83 | 78 | global $wgRequest, $wgOut; |
84 | 79 | global $wgSkin; |
85 | 80 | $this->setHeaders(); |
— | — | @@ -107,7 +102,7 @@ |
108 | 103 | $text = ""; |
109 | 104 | $text .= '<p>This category does not exist yet. Create this category and its page schema: </p>'; |
110 | 105 | $text .= ' <form id="createPageSchemaForm" action="" method="post">' . "\n"; |
111 | | - $text .= '<p>Name of schema: <input type="text" /> </p> '; |
| 106 | + $text .= '<p>Name of schema: <input type="text" name="s_name"/> </p> '; |
112 | 107 | $text .= '<p>Additional XML: |
113 | 108 | <textarea rows=4 style="width: 100%" name="ps_add_xml"></textarea> |
114 | 109 | </p> '; |
— | — | @@ -122,10 +117,10 @@ |
123 | 118 | <p>Field name: <input size="15" name="name_1"> |
124 | 119 | Display label: <input size="15" name="label_1"> |
125 | 120 | </p> |
126 | | - <p><input type="checkbox" name="is_list_1" onclick="clickcheckbox(this)" /> |
| 121 | + <p><input type="checkbox" name="is_list_1" class="isListCheckbox" /> |
127 | 122 | This field can hold a list of values |
128 | 123 | </p> |
129 | | - <p>Delimiter for values (default is ","): <input type="text" name="delimiter_1" /> </p> |
| 124 | + <div class="delimiterInput" style="display: none" ><p>Delimiter for values (default is ","): <input type="text" name="delimiter_1" /> </p></div> |
130 | 125 | <p>Additional XML: |
131 | 126 | <textarea rows=4 style="width: 100%" name="add_xml_1"></textarea> |
132 | 127 | </p> |