1// Name: jQuery.ToggleButton.ToggleButtonExtender.debug.js 2// Assembly: AjaxControlToolkit 3// Version: 4.1.7.1213 4// FileVersion: 4.1.7.1213 5// (c) 2010 CodePlex Foundation 6(function (window, $) { 7 8 $act.createWidget('toggleButtonExtender', { 9 idDecoration: '_ToggleButton', 10 11 _create: function() { 12 13 var self = this, 14 el = self.element[0], 15 id = el.id + this.idDecoration, 16 container = $('<div/>').insertBefore(el).css({ position: 'relative' }), 17 opt = self.options; 18 19 self._decoyElement = $('<a/>').appendTo(container) 20 .attr({ id: id, href: '' }) 21 .css({ 22 position: 'absolute', 23 left: '0px', 24 top: '0px', 25 width: opt.imageWidth + 'px', 26 height: opt.imageHeight + 'px', 27 'font-size': opt.imageHeight + 'px', 28 'background-repeat': 'no-repeat' 29 }); 30 31 $(el).css({ visibility: 'hidden' }); 32 33 self.onClick(); 34 35 $(el).change(function () { 36 self.onClick(); 37 }); 38 39 $(this._decoyElement).click(function (ev) { 40 ev.preventDefault(); 41 $(el).click(); 42 }).hover(function () { 43 self._onDecoyElementMouseOver(); 44 }, function () { 45 self._onDecoyElementMouseOut(); 46 }); 47 48 if (window.$act.browser.agent === window.$act.browser.InternetExplorer) { 49 container.parent().find('label').each(function () { 50 if (el.id == $(this).prop('htmlFor')) { 51 $(this).prop('htmlFor', id); 52 } 53 }); 54 } 55 }, 56 57 onClick: function () { 58 /// <summary> 59 /// Handle the element's click events 60 /// </summary> 61 62 var self = this, 63 el = self.element[0], 64 opt = self.options; 65 66 if (!el) 67 return; 68 69 if (el.checked) { 70 self._decoyElement.css('background-image', 'url(' + (el.disabled ? opt.disabledCheckedImageUrl : opt.checkedImageUrl) + ')'); 71 if (opt.checkedImageAlternateText) { 72 self._decoyElement.prop('title', opt.checkedImageAlternateText); 73 } 74 } else { 75 self._decoyElement.css('background-image', 'url(' + (el.disabled ? opt.disabledUncheckedImageUrl : opt.uncheckedImageUrl) + ')'); 76 if (opt.uncheckedImageAlternateText) { 77 self._decoyElement.prop('title', opt.uncheckedImageAlternateText); 78 } 79 } 80 }, 81 82 _onDecoyElementClick: function (e) { 83 /// <summary> 84 /// Handle the decoy element's click events 85 /// </summary> 86 87 this.element.click(); 88 e.preventDefault(); 89 return false; 90 }, 91 92 _onDecoyElementMouseOver: function () { 93 /// <summary> 94 /// Handle the decoy element's mouseover event 95 /// </summary> 96 97 var self = this, 98 el = self.element[0], 99 opt = self.options; 100 101 if (el && !el.disabled) { 102 if (el.checked && opt.checkedImageOverUrl) { 103 self._decoyElement.css('background-image', 'url(' + opt.checkedImageOverUrl + ')'); 104 if (opt.checkedImageOverAlternateText) { 105 self._decoyElement.prop('title', opt.checkedImageOverAlternateText); 106 } 107 } else if (!el.checked && opt.uncheckedImageOverUrl) { 108 self._decoyElement.css('background-image', 'url(' + opt.uncheckedImageOverUrl + ')'); 109 if (opt.uncheckedImageOverAlternateText) { 110 self._decoyElement.prop('title', opt.uncheckedImageOverAlternateText); 111 } 112 } 113 } 114 }, 115 116 _onDecoyElementMouseOut: function () { 117 /// <summary> 118 /// Handle the decoy element's mouseout event 119 /// </summary> 120 121 this.onClick(); 122 } 123 });
124 125})(window, actJQuery);
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.