Subversion Repositories My Stuff

Compare Revisions

Ignore whitespace Rev 13 → Rev 14

/trunk/JavaScripts/comment_form.js
0,0 → 1,90
/*#######################################################################
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# Author: Andrzej Kardas
# License: GPLv3
# The full version of the licencse can be obtainted by visiting:
# http://www.gnu.org/licenses/gpl.html
#######################################################################*/
$(document).ready(function(){
checkBoxChange();
toggleLinkClick();
checkboxChacked();
var $options = {
success: function(data) {
var response = $(data).find('#comments');
$('#comments').replaceWith(response);
$('#comment_form').find('form:first').validator().ajaxForm($options);
checkboxChacked();
checkBoxChange();
toggleLinkClickSlide();
$('#comment_form > #comments-indicator').hide();
},
beforeSubmit: function() {
$('#comment_form > #comments-indicator').show();
}
};
$('#comment_form').find('form:first').validator().ajaxForm($options);
});
 
function checkboxChacked(){
var form = $('#comment_form').find('form:first');
var checkbox = form.find(':checkbox:first');
var email = form.find(':email');
if (checkbox.is(':checked')){
email.attr("required", "required");
email.attr("disabled", false);
}else{
email.attr("required", false);
email.attr("required", true);
}
}
 
function toggleLinkClickSlide(){
var form = $('#comment_form').find('form:first');
var toggle_link = $('#comments').find('a.toggle_link:first');
var content = $('#comment_form');
toggle_link.click(function(){
if (toggle_link.is('.toggle_close')){
toggle_link.removeClass('toggle_close');
toggle_link.addClass('toggle_open');
} else if (toggle_link.is('.toggle_open')){
toggle_link.removeClass('toggle_open');
toggle_link.addClass('toggle_close');
}
content.slideToggle('slow');
var api = form.data("validator");
api.reset();
return false;
});
}
 
function toggleLinkClick(){
var form = $('#comment_form').find('form:first');
var toggle_link = $('#comments').find('a.toggle_link:first');
toggle_link.click(function(){
var api = form.data("validator");
api.reset();
return false;
});
}
 
function checkBoxChange(){
var form = $('#comment_form').find('form:first');
var email = form.find(':email');
$('#comment_form').find(':checkbox:first').change(function(){
if ($(this).is(':checked')) {
email.attr("required", "required");
email.attr("disabled", false);
}else{
email.attr("required", false);
email.val("");
email.attr("disabled", true);
var api = form.data("validator");
api.reset(email);
}
});
}
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: JavaScripts/email_form.js
===================================================================
--- JavaScripts/email_form.js (revision 13)
+++ JavaScripts/email_form.js (revision 14)
@@ -21,4 +21,5 @@
}
};
$('#email_form > form').ajaxForm(options);
+
});
\ No newline at end of file
Index: JavaScripts/youtube_dialog.js
===================================================================
--- JavaScripts/youtube_dialog.js (revision 13)
+++ JavaScripts/youtube_dialog.js (revision 14)
@@ -9,6 +9,7 @@
# http://www.gnu.org/licenses/gpl.html
#######################################################################*/
$.fx.speeds._default = 1000;
+$.ajaxSettings.cache = false;
$(document).ready(function() {
$('a.film_link').each(function() {
var $link = $(this);
@@ -28,8 +29,8 @@
$('#overlay').show();
$('#ajax-indicator').show();
$dialog.load($link.attr('href')+' #film',function(){
- $('#ajax-indicator').hide();
- $('#overlay').hide();
+ $('#ajax-indicator').hide();
+ $('#overlay').hide();
$dialog.dialog('open');
});
return false;