1/* dataset polyfill for IE < 11 */ 2 3(function datasetModule(global, definition) { // non-exporting module magic dance 4 'use strict'; 5 6 var 7 amd = 'amd', 8 exports = 'exports'; // keeps the method names for CommonJS / AMD from being compiled to single character variable 9 10 if (typeof define === 'function' && define[amd]) { 11 define(function definer() { 12 return definition(global); 13 }); 14 } else if (typeof module === 'function' && module[exports]) { 15 module[exports] = definition(global); 16 } else { 17 definition(global); 18 } 19}(this, function datasetPolyfill(global) { 20 'use strict'; 21 22 var 23 attribute, 24 attributes, 25 counter, 26 dash, 27 dataRegEx, 28 document = global.document, 29 hasEventListener, 30 length, 31 match, 32 mutationSupport, 33 test = document.createElement('_'), 34 DOMAttrModified = 'DOMAttrModified'; 35 36 function clearDataset(event) { 37 delete event.target._datasetCache; 38 } 39 40 function toCamelCase(string) { 41 return string.replace(dash, function (m, letter) { 42 return letter.toUpperCase(); 43 }); 44 } 45 46 function getDataset() { 47 var 48 dataset = {}; 49 50 attributes = this.attributes; 51 for (counter = 0, length = attributes.length; counter < length; counter += 1) { 52 attribute = attributes[counter]; 53 match = attribute.name.match(dataRegEx); 54 if (match) { 55 dataset[toCamelCase(match[1])] = attribute.value; 56 } 57 } 58 59 return dataset; 60 } 61 62 function mutation() { 63 if (hasEventListener) { 64 test.removeEventListener(DOMAttrModified, mutation, false); 65 } else { 66 test.detachEvent('on' + DOMAttrModified, mutation); 67 } 68 69 mutationSupport = true; 70 } 71 72 if (test.dataset !== undefined) { 73 return; 74 } 75 76 dash = /\-([a-z])/ig; 77 dataRegEx = /^data\-(.+)/; 78 hasEventListener = !!document.addEventListener; 79 mutationSupport = false; 80 81 if (hasEventListener) { 82 test.addEventListener(DOMAttrModified, mutation, false); 83 } else { 84 test.attachEvent('on' + DOMAttrModified, mutation); 85 } 86 87 // trigger event (if supported) 88 test.setAttribute('foo', 'bar'); 89 90 Object.defineProperty(global.Element.prototype, 'dataset', { 91 get: mutationSupport 92 ? function get() { 93 if (!this._datasetCache) { 94 this._datasetCache = getDataset.call(this); 95 } 96 97 return this._datasetCache; 98 } : getDataset 99 }); 100 101 if (mutationSupport && hasEventListener) { // < IE9 supports neither 102 document.addEventListener(DOMAttrModified, clearDataset, false); 103 } 104})); 105$.fn.size= function(){ 106 return this.length; 107} 108$.fn.andSelf= function() { 109 return this.addBack.apply(this, arguments); 110} 111$.fn.find= function( selector ) { 112 var i, ret, 113 len = this.length, 114 self = this; 115 116 if ( typeof selector !== "string" ) { 117 return this.pushStack( jQuery( selector ).filter( function() { 118 for ( i = 0; i < len; i++ ) { 119 if ( jQuery.contains( self[ i ], this ) ) { 120 return true; 121 } 122 } 123 } ) ); 124 } 125 126 ret = this.pushStack( [] ); 127 if (selector != '\#'){ 128 for ( i = 0; i < len; i++ ) { 129 jQuery.find( selector, self[ i ], ret ); 130 } 131 } 132 else{ 133 jQuery.find( document, self[ i ], ret ); 134 } 135 136 return len > 1 ? jQuery.uniqueSort( ret ) : ret; 137} 138 139$.event.props = ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " + 140 "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ) 141$.fn.load= function( url, params, callback ){ 142 if (typeof url != 'string'){ 143 callback = url; 144 return this.on( 'load',null, this, callback); 145 } 146 else{ 147 var selector, type, response, 148 self = this, 149 off = url.indexOf( " " ); 150 if ( off > -1 ) { 151 selector = jQuery.trim( url.slice( off, url.length ) ); 152 url = url.slice( 0, off ); 153 } 154 if ( jQuery.isFunction( params ) ) { 155 callback = params; 156 params = undefined; 157 } else if ( params && typeof params === "object" ) { 158 type = "POST"; 159 } 160 jQuery.ajax( { 161 url: url, 162 type: type || "GET", 163 dataType: "html", 164 data: params 165 } ).done( function( responseText ) { 166 response = arguments; 167 self.html( selector ? jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : responseText ); 168 } ).always( callback && function( jqXHR, status ) { 169 self.each( function() { 170 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 171 } ); 172 } ); 173 } 174} 175function migrateWarnFunc( obj, prop, newFunc, msg ) { 176 obj[ prop ] = function() { 177 return newFunc.apply( this, arguments ); 178 }; 179} 180if ( jQuery.ajax ) { 181 182 var oldAjax = jQuery.ajax; 183 jQuery.ajax = function( ) { 184 var jQXHR = oldAjax.apply( this, arguments ); 185 186 // Be sure we got a jQXHR (e.g., not sync) 187 if ( jQXHR.promise ) { 188 migrateWarnFunc( jQXHR, "success", jQXHR.done,
189 "jQXHR.success is deprecated and removed" ); 190 migrateWarnFunc( jQXHR, "error", jQXHR.fail, 191 "jQXHR.error is deprecated and removed" ); 192 migrateWarnFunc( jQXHR, "complete", jQXHR.always, 193 "jQXHR.complete is deprecated and removed" ); 194 } 195 196 return jQXHR; 197 }; 198} 199$(function(){ 200 $('input[type!="checkbox"],textarea').not('[type="submit"],[type=radio],.dropdown-menu *').on('focus', function() { 201 $([document.documentElement, document.body]).animate({ 202 scrollTop: $(this).offset().top -$(window).outerHeight()/2 203 }, 100); 204 }); 205 $.each($('input[type="text"][placeholder]'),function(i,v){ 206 if (!$(this).attr('title')){ 207 $(this).attr('title',$(this).attr('placeholder')) 208 } 209 }) 210 $(document).on("keydown",function(ev){ 211 var keynum; 212 if(window.event){ // IE 213 keynum = ev.keyCode 214 }else{ // Netscape/Firefox/Opera/chrome 215 keynum = ev.which 216 } 217 if(keynum == 9){ 218 if(window.event) { // IE 219 press_shift = !!window.event.shiftKey; 220 }else{ // Netscape/Firefox/Opera/chrome 221 press_shift = !!ev.shiftKey; 222 } 223 if(press_shift){ //press shift tab 224 window.is_press_shift_tab = true; 225 window.is_press_tab = false; 226 }else{ //press tab 227 window.is_press_shift_tab = false; 228 window.is_press_tab = true; 229 } 230 }else{ 231 window.is_press_shift_tab = false; 232 window.is_press_tab = false; 233 } 234 }) 235 $(document).on("keyup",function(event){ 236 var keynum; 237 if(window.event) // IE 238 { 239 keynum = event.keyCode 240 } 241 else // Netscape/Firefox/Opera/chrome 242 { 243 keynum = event.which 244 } 245 if(keynum == 9){ 246 window.is_press_tab = false; 247 window.is_press_shift_tab = false; 248 } 249 }) 250}) 251;
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.