r93270 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93269‎ | r93270 | r93271 >
Date:14:38, 27 July 2011
Author:ankitgarg833
Status:deferred
Tags:
Comment:
adding code for dynamic javascript loading for delimeter input
Modified paths:
  • /trunk/extensions/PageSchemas/specials/PS_EditSchema.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PageSchemas/specials/PS_EditSchema.php
@@ -45,9 +45,6 @@
4646 });
4747 jQuery('#templatesList').append(newField);
4848 }
49 -function clickcheckbox(form){
50 -alert('Handler for .change() uncalled.');
51 -}
5249
5350 jQuery(document).ready(function() {
5451 jQuery(".deleteField").click( function() {
@@ -59,7 +56,16 @@
6057 // Remove the encompassing div for this instance.
6158 jQuery(this).closest(".templateBox")
6259 .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+
6470 });
6571
6672 </script>
@@ -67,18 +73,7 @@
6874 END;
6975 $wgOut->addScript( $jsText );
7076 }
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 ) {
8378 global $wgRequest, $wgOut;
8479 global $wgSkin;
8580 $this->setHeaders();
@@ -107,7 +102,7 @@
108103 $text = "";
109104 $text .= '<p>This category does not exist yet. Create this category and its page schema: </p>';
110105 $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> ';
112107 $text .= '<p>Additional XML:
113108 <textarea rows=4 style="width: 100%" name="ps_add_xml"></textarea>
114109 </p> ';
@@ -122,10 +117,10 @@
123118 <p>Field name: <input size="15" name="name_1">
124119 Display label: <input size="15" name="label_1">
125120 </p>
126 - <p><input type="checkbox" name="is_list_1" onclick="clickcheckbox(this)" />
 121+ <p><input type="checkbox" name="is_list_1" class="isListCheckbox" />
127122 This field can hold a list of values
128123 </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>
130125 <p>Additional XML:
131126 <textarea rows=4 style="width: 100%" name="add_xml_1"></textarea>
132127 </p>

Status & tagging log