1 2if (!DG)var DG = {}; 3 4DG.OnOffSwitchAuto = function (config) { 5 6 var properties = DG.OnOffSwitchProperties; 7 8 $( document ).ready(function() { 9 if(config.cls){ 10 var els = $(config.cls); 11 var index = 0; 12 for(var i=0,len=els.length;i<len;i++){ 13 var elementConfig = jQuery.extend({}, config); 14 var el = $(els[i]); 15 if(!els[i].id){ 16 els[i].id = "dg-switch-" + index; 17 index++; 18 } 19 elementConfig.el = "#" + els[i].id 20 21 for(var j=0;j<properties.length;j++){ 22 var attr = "data-"+ properties[j]; 23 var val = el.attr(attr); 24 if(val){ 25 elementConfig[properties[j]] = val; 26 } 27 } 28 29 new DG.OnOffSwitch( 30 elementConfig 31 ); 32 } 33 } 34 }); 35 36 37}; 38
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.