{% extends "v2/modules/gsoc/form_base.html" %}
{% comment %}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
{% endcomment %}


{% block dependencies %}
  [
    dep.uniform,
    null,
    function () {
      jQuery("select, input:radio, input:file, input:checkbox").uniform();
      var fields = ["description", "contrib_template", "accepted_student_msg", "rejected_student_msg"];
      tinyMCE.init(melange.tinyMceConfig(fields, "advanced"));
    }
  ]
{% endblock dependencies %}

{% extends "v2/modules/gsoc/form_base.html" %}
{% comment %}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
{% endcomment %}


{% block dependencies %}
  [
    dep.jqueryui.effects.blind,
    dep.uniform,
    null,
    function () {
      jQuery("select, input:radio, input:file, input:checkbox").uniform();

      jQuery(document).ready(function () {

        jQuery(':checkbox[value="Other"],:radio').each(function () {
          if ($(this).val() == "Other") {
            var selector = "#form_row_" + $(this).attr("name") + "-other";
            if ($(this).parent().attr("class") == "checked") {
              jQuery(selector).show();
            } else {
              jQuery(selector).hide();
            }
          }
        });

        jQuery(':radio').change(function () {
          var selector = "#form_row_" + $(this).attr("name") + "-other";
          if ($(this).val() != "Other") {
            jQuery(selector).hide("Blind");
          } else {
            jQuery(selector).show("Blind");
          }
        });
        jQuery(':checkbox[value="Other"]').change(function () {
          var selector = "#form_row_" + $(this).attr("name") + "-other";
          jQuery(selector).toggle("Blind");
        });
      });
    }
  ]
{% endblock dependencies %}

Create toggle effects for the Other text field.
Create toggle effects for the Other text field.

This toggle effect works based on the value selected in the corresponding
checkbox or radio field's set of options.
