1 var $st = jQuery.noConflict(); 2 3//Setting Global Variables 4var G_tilesArray = new Array(); 5 6 7$st.fn.tyler = function (oSetting) 8{ 9 // Save this object in G_variables. 10 if ($st(this).length) 11 { 12 $st(this).each(function () { 13 14 $st(this).css('columns','1'); 15 var theTyler = 16 { 17 parent: $st(this), 18 childs: $st(this).children(), 19 nbChilds: $st(this).children().length, 20 parentWidth: 0, 21 nbCol: 0, 22 setting: oSetting 23 } 24 25 if (theTyler.nbChilds > 0) 26 { 27 superTylerInator(theTyler); 28 G_tilesArray.push(theTyler); 29 } 30 }); 31 } 32} 33 34function getNumberOfCol(oTyler) 35{ 36 var theNbColsTemp = Math.floor(oTyler.parent.width() / oTyler.setting.minWidth); 37 //if ((oTyler.setting.minWidth * theNbColsTemp) + (oTyler.setting.space * (theNbColsTemp - 1))) theNbColsTemp = theNbColsTemp - 1; 38 if (theNbColsTemp < 1) theNbColsTemp = 1; 39 else if (theNbColsTemp > oTyler.nbChilds) theNbColsTemp = oTyler.nbChilds; 40 41 return theNbColsTemp; 42} 43 44function createCol(oTyler) 45{ 46 var theCols = new Array(); 47 48 for (var ooI = 0; ooI < oTyler.nbCol; ooI++) 49 { 50 var theSpace = oTyler.setting.space / (oTyler.nbCol); 51 var theNewColWith = (100 / oTyler.nbCol); 52 var theNewCol = $st('<div class="st-column">'); 53 theNewCol.css('display','inline-block'); 54 theNewCol.css('vertical-align','top'); 55 theNewCol.css('width','calc(' + theNewColWith + '% - ' + Math.ceil(oTyler.setting.space - theSpace + 1) + 'px)'); 56 if (ooI != oTyler.nbCol - 1)theNewCol.css('margin-right',oTyler.setting.space + 'px'); 57 theCols.push(theNewCol); 58 } 59 return theCols; 60} 61 62function pushToCol(oTyler) 63{ 64 var colCounter = 0; 65 oTyler.childs.each(function () { 66 67 $st(this).appendTo(oTyler.column[colCounter]); 68 69 colCounter++; 70 if (colCounter >= oTyler.nbCol) colCounter = 0; 71 }); 72 73 for (var ooI = 0; ooI < oTyler.nbCol; ooI++) 74 { 75 oTyler.column[ooI].appendTo(oTyler.parent); 76 } 77} 78 79function superTylerInator(oTyler) 80{ 81 if (oTyler.parentWidth != oTyler.parent.width()) 82 { 83 oTyler.parentWidth = oTyler.parent.width(); 84 85 var theNbCols = getNumberOfCol(oTyler); 86 if (theNbCols != oTyler.nbCol) 87 { 88 oTyler.nbCol = theNbCols; 89 90 91 $st.each(oTyler.column, function (ooIndex, ooObject) 92 { 93 ooObject.remove(); 94 }); 95 96 oTyler.column = createCol(oTyler); 97 pushToCol(oTyler); 98 } 99 } 100} 101 102 103 104 105$st( window ).resize(function() { 106 $st.each(G_tilesArray, function (oIndex, oObject) 107 { 108 superTylerInator(oObject); 109 }); 110 111});
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.