1// Name: HTMLEditor.Toolbar_buttons.CommonButton.debug.js 2// Assembly: AjaxControlToolkit 3// Version: 4.1.7.1213 4// FileVersion: 4.1.7.1213 5Type.registerNamespace("Sys.Extended.UI.HTMLEditor.ToolbarButton"); 6 7Sys.Extended.UI.HTMLEditor.ToolbarButton.CommonButton = function(element) { 8 Sys.Extended.UI.HTMLEditor.ToolbarButton.CommonButton.initializeBase(this, [element]); 9 10 this._loaded = false; 11 this._preservePlace = false; 12 this._editPanel = null; 13 this._activeModes = null; 14 this._app_onload$delegate = Function.createDelegate(this, this._app_onload); 15 this._cssClass = ""; 16 17 this._onmouseover$delegate = Function.createDelegate(this, this._onmouseover); 18 this._onmouseout$delegate = Function.createDelegate(this, this._onmouseout); 19 this._onmousedown$delegate = Function.createDelegate(this, this._onmousedown); 20 this._onmouseup$delegate = Function.createDelegate(this, this._onmouseup); 21 this._onclick$delegate = Function.createDelegate(this, this._onclick); 22} 23 24Sys.Extended.UI.HTMLEditor.ToolbarButton.CommonButton.prototype = { 25 26 get_preservePlace: function() { 27 return this._preservePlace; 28 }, 29 set_preservePlace: function(value) { 30 this._preservePlace = value; 31 }, 32 33 set_activeEditPanel: function(value) { 34 this._editPanel = value; 35 if (this._editPanel == null) { 36 this.hideButton(); 37 } else { 38 if (this.isAllowedActiveMode(this._editPanel.get_activeMode()) && this.canBeShown()) { 39 this.showButton(); 40 this.onEditPanelActivity(); 41 } else { 42 this.hideButton(); 43 } 44 } 45 }, 46 47 isImage: function() { 48 return true; 49 }, 50 51 checkRangeInDesign: function() { 52 if (typeof this._designPanel == "undefined") return false; 53 if (this._designPanel == null) return false; 54 if (this._designPanel.isPopup()) return false; 55 56 var parent = Sys.Extended.UI.HTMLEditor.getSelParent(this._designPanel); 57 if (parent.nodeType == 3) parent = parent.parentNode; 58 return (parent.ownerDocument == this._designPanel._doc); 59 }, 60 61 get_buttonName: function() { 62 var name = Object.getType(this).getName(); 63 name = name.substring(name.lastIndexOf(".") + 1); 64 return name; 65 }, 66 67 get_message: function(messageName) { 68 var expression = "Sys.Extended.UI.Resources.HTMLEditor_toolbar_button_" + this.get_buttonName() + "_message_" + messageName; 69 return eval(expression); 70 }, 71 72 isDisplayed: function() { 73 var element = this.get_element(); 74 if (element) { 75 var style = element.style; 76 return (style.display != "none" && style.visibility != "hidden"); 77 } else { 78 return false; 79 } 80 }, 81 82 hideButton: function() { 83 var element = this.get_element(); 84 if (element) { 85 if (!this._preservePlace) { 86 element.style.display = "none"; 87 } else { 88 element.style.visibility = "hidden"; 89 } 90 } 91 }, 92 93 showButton: function() { 94 var element = this.get_element(); 95 if (element) { 96 if (element.style.display == "none") { 97 element.style.display = ""; 98 } 99 if (this._preservePlace) { 100 element.style.visibility = "visible"; 101 } 102 } 103 }, 104 105 canBeShown: function() { 106 return true; 107 }, 108 109 onEditPanelActivity: function() { 110 }, 111 112 get_activeModes: function() { 113 if (this._activeModes == null) { 114 this._activeModes = []; 115 } 116 return this._activeModes; 117 }, 118 set_activeModes: function(value) { 119 this.get_activeModes().push(value); 120 }, 121 122 get_activeModesIds: function() { 123 }, 124 set_activeModesIds: function(value) { 125 var arr = value.split(";"); 126 for (var i = 0; i < arr.length; i++) { 127 this.set_activeModes(parseInt(arr[i])); 128 } 129 }, 130 131 set_toolTip: function(value) {
132 this.get_element().title = value; 133 }, 134 get_toolTip: function() { 135 return this.get_element().title; 136 }, 137 138 isAllowedActiveMode: function(value) { 139 for (var i = 0; i < this.get_activeModes().length; i++) { 140 if (this.get_activeModes()[i] == value) { 141 return true; 142 } 143 } 144 return false; 145 }, 146 147 initialize: function() { 148 Sys.Extended.UI.HTMLEditor.ToolbarButton.CommonButton.callBaseMethod(this, "initialize"); 149 150 Sys.Application.add_load(this._app_onload$delegate); 151 var element = this.get_element(); 152 153 if (this._preservePlace && !this.canBeShown()) { 154 element.style.display = "none"; 155 } 156 157 this._cssClass = element.className; 158 159 if (this.isImage()) { 160 $addHandlers(element, { 161 mouseover: this._onmouseover$delegate, 162 mouseout: this._onmouseout$delegate, 163 mousedown: this._onmousedown$delegate, 164 mouseup: this._onmouseup$delegate, 165 click: this._onclick$delegate 166 }); 167 } 168 169 if (Sys.Extended.UI.HTMLEditor.isIE) { 170 function diveSelectable(el) { 171 if (el.nodeType == 1 && el.tagName) { 172 var tag = el.tagName.toUpperCase(); 173 if (tag != "INPUT" && tag != "TEXTAREA" && tag != "IFRAME") { 174 el.unselectable = "on"; 175 } 176 for (var k = 0; k < el.childNodes.length; k++) { 177 diveSelectable(el.childNodes.item(k)); 178 } 179 } 180 } 181 182 diveSelectable(element); 183 } else { 184 try { 185 element.style.MozUserSelect = "none"; 186 element.parentNode.style.MozUserSelect = "none"; 187 } catch (ex) { } 188 } 189 }, 190 191 dispose: function() { 192 if (this.isImage()) { 193 $common.removeHandlers(this.get_element(), { 194 mouseover: this._onmouseover$delegate, 195 mouseout: this._onmouseout$delegate, 196 mousedown: this._onmousedown$delegate, 197 mouseup: this._onmouseup$delegate, 198 click: this._onclick$delegate 199 }); 200 } 201 202 this._loaded = false; 203 Sys.Application.remove_load(this._app_onload$delegate); 204 Sys.Extended.UI.HTMLEditor.ToolbarButton.CommonButton.callBaseMethod(this, "dispose"); 205 }, 206 207 _app_onload: function(sender, e) { 208 this.onButtonLoaded(); 209 this._loaded = true; 210 }, 211 212 onButtonLoaded: function() { 213 }, 214 215 _onmouseover: function(e) { 216 if (!this.isEnable()) { 217 return false; 218 } 219 Sys.UI.DomElement.addCssClass(this.get_element(), this._cssClass + "_hover"); 220 return true; 221 }, 222 223 _onmouseout: function(e) { 224 if (!this.isEnable()) { 225 return false; 226 } 227 Sys.UI.DomElement.removeCssClass(this.get_element(), this._cssClass + "_hover"); 228 Sys.UI.DomElement.removeCssClass(this.get_element(), this._cssClass + "_mousedown"); 229 return true; 230 }, 231 232 _onmousedown: function(e) { 233 if (!this.isEnable()) { 234 return null; 235 } 236 Sys.UI.DomElement.addCssClass(this.get_element(), this._cssClass + "_mousedown"); 237 return false; 238 }, 239 240 _onmouseup: function(e) { 241 if (!this.isEnable()) { 242 return false; 243 } 244 Sys.UI.DomElement.removeCssClass(this.get_element(), this._cssClass + "_mousedown"); 245 return true; 246 }, 247 248 _onclick: function(e) { 249 if (!this.isEnable()) { 250 return false; 251 } 252 return true; 253 }, 254 255 isEnable: function() { 256 if (!this._loaded) { 257 return false; 258 } 259 if (this._editPanel == null) { 260 return false; 261 } 262 return true; 263 }, 264 265 setActivity: function(value) { 266 if (value) {
267 Sys.UI.DomElement.addCssClass(this.get_element(), this._cssClass + "_active"); 268 } else { 269 Sys.UI.DomElement.removeCssClass(this.get_element(), this._cssClass + "_active"); 270 } 271 } 272} 273 274Sys.Extended.UI.HTMLEditor.ToolbarButton.CommonButton.registerClass("Sys.Extended.UI.HTMLEditor.ToolbarButton.CommonButton", Sys.UI.Control); 275
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.