1// Name: jQuery.Common.Common.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.args = { 9 cancelEventArgs: function() { 10 this._cancel = false; 11 12 this.get_cancel = function() { 13 return this._cancel; 14 }; 15 16 this.set_cancel = function(val) { 17 this._cancel = val; 18 }; 19 } 20}; 21$act.string = { 22 format: function() { 23 var s = arguments[0]; 24 for (var i = 0; i < arguments.length - 1; i++) { 25 var reg = new RegExp("\\{" + i + "\\}", "gm"); 26 s = s.replace(reg, arguments[i + 1]); 27 } 28 29 return s; 30 } 31}; 32$act.resources = Sys.Extended.UI.Resources; 33 34 $act.common = { 35 36 activateWidget: function (widgetName, el, options) { 37 var metadata = this.parseMetaData(widgetName, $(el)), 38 widget = $(el)[widgetName]($.extend(metadata, options)) 39 .data("ajaxControlToolkit-" + widgetName); 40 41 var id = widget.options.id || widget.element.attr('id'); 42 $act.behaviors[id] = widget; 43 44 return widget; 45 }, 46 47 parseMetaData: function(name, el) { 48 var dataAttrName = 'act-' + name.toLowerCase(), 49 strMetadata = el.data(dataAttrName); 50 51 if (!strMetadata) { 52 var dataElement = $("data[data-act-target='" + el.attr('id') + "']"); 53 if (dataElement) 54 strMetadata = dataElement.data(self.dataAttrName); 55 } 56 if (!strMetadata) 57 return null; 58 59 var rgx = /(\w+)(.|\s+)(:)/g, pimp = function(s) { 60 return '#$%<*' + s + '$%@#<'; 61 }, 62 props = strMetadata.match(rgx), 63 tmpMetadata = strMetadata.replace(rgx, pimp('$1$2$3')), 64 obj = {}; 65 66 for (var i = 0; i < props.length; i++) { 67 var prop = pimp(props[i]), 68 idx = tmpMetadata.indexOf(prop) + prop.length, 69 nextIdx = (i < props.length - 1) 70 ? tmpMetadata.indexOf(pimp(props[i + 1])) - 1 71 : tmpMetadata.length, 72 propVal = tmpMetadata.substring(idx, nextIdx); 73 74 if (propVal.startsWith("'") && propVal.endsWith("'")) 75 propVal = $('<div/>').html(propVal.substr(1, propVal.length - 2)).text(); 76 77 else if (!isNaN(propVal)) 78 propVal = parseFloat(propVal); 79 else { 80 81 var val=propVal.toLowerCase().trim(); 82 if (val == "true" || val == "false") 83 propVal = Boolean(val == "true" ? 1 : 0); 84 } 85 86 obj[props[i].trim().slice(0, -1)] = propVal; 87 } 88 89 return obj; 90 }, 91 92 doPostBack: function () { 93 if (!window.__doPostBack) 94 throw "can't find MS Ajax __doPostBack method"; 95 96 return window.__doPostBack.apply(window, arguments); 97 }, 98 99 pascalCase: function(str) { 100 return str.charAt(0).toUpperCase() + str.substr(1); 101 } 102 }; 103 104})(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.