1 2(function ($) { 3 4 $.fn.prettycheckbox = function (options) { 5 6 /* IE6 background flicker fix */ 7 try { document.execCommand('BackgroundImageCache', false, true); } catch (e) { } 8 9 var checked = m_appRootPath + 'Images/checked.gif'; 10 var unchecked = m_appRootPath + 'Images/unchecked.gif'; 11 var checked_dis = m_appRootPath + 'Images/checked_dis.gif'; 12 var unchecked_dis = m_appRootPath + 'Images/unchecked_dis.gif'; 13 14 /* Default settings */ 15 var settings = { 16 imgChecked: checked, 17 imgUnchecked: unchecked, 18 imgChecked_dis: checked_dis, 19 imgUnchecked_dis: unchecked_dis 20 }; 21 22 /* Processing settings */ 23 settings = $.extend(settings, options || {}); 24 25 /* Wrapping all passed elements */ 26 return this.each(function () { 27 var ch = this; 28 29 $('label[for=' + this.id + ']').attr("style", "display: none"); 30 31 /* Creating wrapper for each checkbox, also i */ 32 if ($("#" + this.id).is(':enabled')) { 33 34 if ($("#" + this.id).is(':checked')) { 35 ch.wrapper = $('<span class="mark" style="display:inline;cursor:pointer"><img style="width: 22px; height: 22px; padding-right: 4px; padding-bottom: 4px; display: inline;" src="' + settings.imgChecked + '" />' + $('label[for=' + this.id + ']').text()+'</span>'); 36 } 37 else { 38 ch.wrapper = $('<span class="mark" style="display:inline;cursor:pointer"><img style="width: 22px; height: 22px; padding-right: 4px; padding-bottom: 4px; display: inline;" src="' + settings.imgUnchecked + '" />' + $('label[for=' + this.id + ']').text() +'</span>'); 39 } 40 } 41 else { 42 if ($("#" + this.id).is(':checked')) { 43 ch.wrapper = $('<span class="mark" style="display:inline;cursor:pointer"><img style="width: 22px; height: 22px; padding-right: 4px; padding-bottom: 4px; display: inline;" src="' + settings.imgChecked_dis + '" />' + $('label[for=' + this.id + ']').text() +'</span>'); 44 } 45 else { 46 ch.wrapper = $('<span class="mark" style="display:inline;cursor:pointer"><img style="width: 22px; height: 22px; padding-right: 4px; padding-bottom: 4px; display: inline;" src="' + settings.imgUnchecked_dis + '" />' + $('label[for=' + this.id + ']').text() +'</span>'); 47 } 48 } 49 50 ch.image = ch.wrapper.children('img'); 51 var wrapperElementId = this.id; 52 53 if ($("#" + wrapperElementId).is(':enabled')) { 54 /*mouse click event handling toggle check / uncheck image*/ 55 ch.wrapper.click( 56 function () { 57 if (ch.image.attr("src") == settings.imgChecked) 58 ch.image.attr("src", settings.imgUnchecked); 59 else 60 ch.image.attr("src", settings.imgChecked); 61 62 63 //update the checkbox state upon mouse click 64 $("#" + ch.id + " input:checkbox").prop('checked', $("#" + wrapperElementId).is(':checked') ? "" : "checked"); 65 66 if (navigator.appVersion.indexOf("rv:11.0") < 0) { 67 if ($("#" + ch.id).attr("onclick") != undefined) { 68 if ($("#" + ch.id).attr("onclick").indexOf('doPostBack') >= 0 || $("#" + ch.id).attr("onclick").indexOf('this') >= 0) 69 $("#" + ch.id).click(); 70 } 71 else { 72 $("#" + ch.id).click(); 73 } 74 } 75 else { 76 $("#" + ch.id).click(); 77 } 78 } 79 ); 80 } 81 82 //hide the checkbox
83 $(ch).css({ 84 position: 'absolute', 85 zIndex: 1, 86 opacity: 0, 87 cursor: 'pointer', 88 width: ch.wrapper.width(), 89 height: ch.wrapper.height() 90 }).on('click', function () { 91 if ($image.attr("src") === settings.imgChecked) { 92 $image.attr("src", settings.imgUnchecked); 93 } else { 94 $image.attr("src", settings.imgChecked); 95 } 96 }); 97 98 ch.wrapper.insertAfter($(ch)); 99 100 return false; 101 }); 102 }; 103})(jQuery); 104 105function SetChanged(hddChangeFlagId) { 106 var hdd = document.getElementById(hddChangeFlagId); 107 hdd.value = 1; 108}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.