Bug 5184 - Upgrade jQuery to the latest version (staff client)

Upgrade jQuery in the staff client. Besides the change
to the jQuery file syntax has been changed wherever this
syntax was written:

$(foo).attr("checked","");

The new correct way to un-check a checkbox:

$(foo).removeAttr("checked");

I also removed some JavaScript altogether from
branch-transfer-limits.tt which used the old syntax but
which wasn't used on the page at all anymore.

Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
Owen Leonard 2012-04-17 11:21:14 -04:00 committed by Paul Poulain
parent c6337e7ea5
commit d1e3773e3b
11 changed files with 31 additions and 64 deletions

View File

@ -5,10 +5,10 @@
if($(this).attr("checked")){
var rowid = $(this).attr("id");
newid = Number(rowid.replace("none",""))
$("#sms"+newid).attr("checked","");
$("#email"+newid).attr("checked","");
$("#digest"+newid).attr("checked","");
$("#rss"+newid).attr("checked","");
$("#sms"+newid).removeAttr("checked");
$("#email"+newid).removeAttr("checked");
$("#digest"+newid).removeAttr("checked");
$("#rss"+newid).removeAttr("checked");
}
});
});
@ -70,12 +70,12 @@
<input type="checkbox"
id="sms[% messaging_preference.message_attribute_id %]"
name="[% messaging_preference.message_attribute_id %]"
value="sms" checked="checked" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').attr('checked','');" />
value="sms" checked="checked" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').removeAttr('checked');" />
[% ELSE %]
<input type="checkbox"
id="sms[% messaging_preference.message_attribute_id %]"
name="[% messaging_preference.message_attribute_id %]"
value="sms" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').attr('checked','');" />
value="sms" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').removeAttr('checked');" />
[% END %]
[% END %]
</td>[% END %]
@ -102,12 +102,12 @@
<input type="checkbox"
id="email[% messaging_preference.message_attribute_id %]"
name="[% messaging_preference.message_attribute_id %]"
value="email" checked="checked" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').attr('checked','');" />
value="email" checked="checked" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').removeAttr('checked');" />
[% ELSE %]
<input type="checkbox"
id="email[% messaging_preference.message_attribute_id %]"
name="[% messaging_preference.message_attribute_id %]"
value="email" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').attr('checked','');" />
value="email" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').removeAttr('checked');" />
[% END %]
[% END %]
</td>
@ -134,12 +134,12 @@
<input type="checkbox"
id="digest[% messaging_preference.message_attribute_id %]"
value="[% messaging_preference.message_attribute_id %]"
name="digest" checked="checked" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').attr('checked','');" />
name="digest" checked="checked" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').removeAttr('checked');" />
[% ELSE %]
<input type="checkbox"
id="digest[% messaging_preference.message_attribute_id %]"
value="[% messaging_preference.message_attribute_id %]"
name="digest" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').attr('checked','');" />
name="digest" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').removeAttr('checked');" />
[% END %]
[% END %]
</td>
@ -158,7 +158,7 @@
<input type="checkbox"
id="rss[% messaging_preference.message_attribute_id %]"
name="[% messaging_preference.message_attribute_id %]"
value="rss" [% messaging_preference.transport_rss %] onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').attr('checked','');" />
value="rss" [% messaging_preference.transport_rss %] onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').removeAttr('checked');" />
[% END %]
</td>
[% ELSE %]

View File

@ -9,19 +9,19 @@ function hideColumns(){
return stringValue.split("/");
});
if(valCookie){
$("#showall").attr("checked","").parent().removeClass("selected");
$("#showall").removeAttr("checked").parent().removeClass("selected");
for( i=0; i<valCookie.length; i++ ){
if(valCookie[i] != ''){
index = valCookie[i] - 2;
$("#itemst td:nth-child("+valCookie[i]+"),#itemst th:nth-child("+valCookie[i]+")").toggle();
$("#checkheader"+index).attr("checked","").parent().removeClass("selected");
$("#checkheader"+index).removeAttr("checked").parent().removeClass("selected");
}
}
}
}
function hideColumn(num) {
$("#hideall,#showall").attr("checked","").parent().removeClass("selected");
$("#hideall,#showall").removeAttr("checked").parent().removeClass("selected");
valCookie = YAHOO.util.Cookie.get("showColumns", function(stringValue){
return stringValue.split("/");
});
@ -62,7 +62,7 @@ Array.prototype.remove = function(from, to) {
};
function showColumn(num){
$("#hideall").attr("checked","").parent().removeClass("selected");
$("#hideall").removeAttr("checked").parent().removeClass("selected");
$("#"+num).parent().addClass("selected");
valCookie = YAHOO.util.Cookie.get("showColumns", function(stringValue){
return stringValue.split("/");
@ -93,7 +93,7 @@ function showAllColumns(){
$("#selections span").addClass("selected");
$("#itemst td:nth-child(2),#itemst tr th:nth-child(2)").nextAll().show();
YAHOO.util.Cookie.remove("showColumns");
$("#hideall").attr("checked","").parent().removeClass("selected");
$("#hideall").removeAttr("checked").parent().removeClass("selected");
}
function hideAllColumns(){
$("#selections").unCheckCheckboxes();

File diff suppressed because one or more lines are too long

View File

@ -16,27 +16,9 @@
$('#selectlibrary').submit();
});
var checkcolumn = $(".checkcolumn");
var checkrow = $(".checkrow");
var checkall = $(".checkall");
var uncheckall = $(".uncheckall");
$(checkcolumn).click(function(){
if(this.checked){ status = "checked" } else { status = "" }
var tableid = $(this).parent().parent().parent().parent().attr("id");
var columncontext = $(this).parent();
var tdindex = columncontext.parent().children().index(columncontext);
$("#"+tableid+" tr td:nth-child("+(tdindex+2)+") input[type='checkbox']").attr("checked",status);
});
$(checkrow).click(function(){
if(this.checked){ status = "checked" } else { status = "" }
$(this).parent().siblings().each(function(){
$(this).find("input[type='checkbox']").attr("checked",status);
})
});
$(checkall).click(function(){
var tid = $(this).attr("id");
tid = tid.replace("CheckAll","");

View File

@ -30,7 +30,7 @@
/* check cookie to hide/show marcdocs*/
if($.cookie("marcdocs_[% borrowernumber %]") == 'false'){
hideMARCdocLinks();
$("#marcDocsSelect").attr('checked',false);
$("#marcDocsSelect").removeAttr('checked');
} else {
/* reset cookie expire date */
$.cookie("marcdocs_[% borrowernumber %]",'true',

View File

@ -109,10 +109,10 @@ var allcheckboxes = $(".checkboxed");
if(e.target.tagName.toLowerCase() == 'td'){
$(this).find("input:checkbox:visible").each( function() {
if($(this).attr("checked")){
$(this).attr("checked",'');
$(this).removeAttr("checked");
} else {
$(this).attr("checked","checked");
radioCheckBox($(this));
// radioCheckBox($(this));
}
});
}
@ -121,7 +121,7 @@ var allcheckboxes = $(".checkboxed");
function radioCheckBox(box){
box.parents("td").siblings().find("input:checkbox:visible").each(function(){
if($(this).attr("checked")){
$(this).attr("checked",'');
$(this).removeAttr("checked");
}
});
}

View File

@ -76,7 +76,7 @@ $(document).ready(function() {
$(this).attr('checked', !$(this).attr('checked'));
if($(this).attr('checked')){
$(this).parent().siblings().find("input:checkbox").each(function(){
if($(this).attr('checked')){ $(this).attr('checked',''); }
if($(this).attr('checked')){ $(this).removeAttr('checked'); }
});
}
});

View File

@ -45,7 +45,7 @@
eBarcode.style.display = 'block';
} else {
eBarcode.style.display = 'none';
$('input[name=barcode_text_print]').attr('checked', false);
$('input[name=barcode_text_print]').removeAttr('checked');
}
}
function getUnit(unit){

View File

@ -110,7 +110,7 @@ function checkMultiHold() {
$("#requestany").click(function() {
if(this.checked){
$("input[name=checkitem]").each(function() {
$(this).attr("checked","");
$(this).removeAttr("checked");
});
}
});
@ -122,7 +122,7 @@ function checkMultiHold() {
}
});
if(onechecked == 1){
$("#requestany").attr("checked","");
$("#requestany").removeAttr("checked");
} else {
$("#requestany").attr("checked","checked");
}

View File

@ -920,7 +920,7 @@ $(document).ready(function() {
[% IF ( history ) %] $("#subscription_form_history").show();[% END %]
$("#cancel_manual_history").click(function(){
$("#subscription_form_history").hide();
$("#manuallist").attr("checked","");
$("#manuallist").removeAttr("checked");
});
$("#manuallist").click( function(){
if($(this).attr("checked")){

View File

@ -19,12 +19,12 @@ for( x=0; x<allColumns.length; x++ ){
$("#itemst").tablesorter({ widgets : ['zebra'], headers: {0:{sorter: false}} });
$("#selectallbutton").click(function() {
$("#itemst").find("input:checkbox").each(function() {
$(this).attr("checked", true);
$(this).attr("checked", "checked");
});
});
$("#clearallbutton").click(function() {
$("#itemst").find("input:checkbox").each(function() {
$(this).attr("checked", false);
$(this).removeAttr("checked");
});
});
$("input[name='disable_input']").click(function() {