1//var app = angular.module('myApp', ['ui.bootstrap', 'toastr']); 2 3var site_url = 'https://samarthinstitute.edu.in/index.php/'; 4var base_url = 'https://samarthinstitute.edu.in/'; 5 6var secretKey = "cms-admin-portal"; 7 8var app = angular.module('myApp', ['ui.bootstrap', 'toastr', 'ngSanitize']); 9 10app.directive('disableRightClick', function () { 11 return { 12 restrict: 'A', 13 link: function (scope, element, attr) { 14 element.bind('contextmenu', function (e) { 15 e.preventDefault(); 16 }) 17 } 18 } 19}) 20 21app.filter('start', function () { 22 return function (input, start) { 23 if (!input || !input.length) { return; } 24 start = +start; 25 return input.slice(start); 26 }; 27}); 28 29app.directive('onLastRepeat', function ($timeout) { 30 return function (scope, element, attrs) { 31 if (scope.$last) { 32 $timeout(function () { 33 const $carousel = $('#carousel-birthday'); 34 35 $carousel.owlCarousel({ 36 loop: true, 37 margin: 15, 38 nav: true, 39 dots: false, 40 autoplay: true, 41 autoplayTimeout: 5000, 42 items: 1, 43 navText: ['<i class="fa fa-chevron-left"></i>', '<i class="fa fa-chevron-right"></i>'], 44 45 onTranslated: function () { 46 const $activeItem = $carousel.find('.owl-item.active .birthday-card'); 47 const currentIndex = $activeItem.data('index'); 48 49 if (typeof currentIndex !== 'undefined') { 50 $timeout(function () { 51 scope.birthdayListArray.forEach((birthday, idx) => { 52 birthday.animateConfetti = idx === currentIndex; 53 birthday.animateCake = idx === currentIndex; 54 }); 55 scope.$apply(); 56 }, 50); 57 } 58 } 59 }); 60 61 // Initial animation trigger 62 $timeout(function () { 63 if (scope.birthdayListArray.length > 0) { 64 scope.birthdayListArray[0].animateConfetti = true; 65 scope.birthdayListArray[0].animateCake = true; 66 scope.$apply(); 67 } 68 }, 100); 69 }); 70 } 71 }; 72 }); 73 74 75 76 77 78 79app.directive("excelExport", function () { 80 return { 81 restrict: "A", 82 scope: { 83 fileName: "@", 84 data: "&exportData" 85 }, 86 replace: true, 87 template: 88 '<button class="btn btn-success btn-sm" ng-click="download()">Download Excel <i class="fa fa-download"></i></button>', 89 link: function (scope, element) { 90 scope.download = function () { 91 function datenum(v, date1904) { 92 if (date1904) v += 1462; 93 var epoch = Date.parse(v); 94 return ( 95 (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000) 96 ); 97 } 98 function getSheet(data, opts) { 99 100 var ws = {}; 101 var range = { s: { c: 10000000, r: 10000000 }, e: { c: 0, r: 0 } }; 102 for (var R = 0; R != data.length; ++R) { 103 for (var C = 0; C != data[R].length; ++C) { 104 if (range.s.r > R) range.s.r = R; 105 if (range.s.c > C) range.s.c = C; 106 if (range.e.r < R) range.e.r = R; 107 if (range.e.c < C) range.e.c = C; 108 var cell = { v: data[R][C] }; 109 if (cell.v == null) continue; 110 var cell_ref = XLSX.utils.encode_cell({ c: C, r: R }); 111 112 if (typeof cell.v === "number") cell.t = "n"; 113 else if (typeof cell.v === "boolean") cell.t = "b"; 114 else if (cell.v instanceof Date) { 115 cell.t = "n"; 116 cell.z = XLSX.SSF._table[14]; 117 cell.v = datenum(cell.v); 118 } else cell.t = "s"; 119 120 ws[cell_ref] = cell; 121 } 122 } 123 if (range.s.c < 10000000) ws["!ref"] = XLSX.utils.encode_range(range); 124 return ws; 125 } 126 127 function Workbook() { 128 if (!(this instanceof Workbook)) return new Workbook(); 129 this.SheetNames = []; 130 this.Sheets = {}; 131 } 132 133 var wb = new Workbook(), 134 ws = getSheet(scope.data()); 135 136 /* add worksheet to workbook */ 137 wb.SheetNames.push(scope.fileName); 138 wb.Sheets[scope.fileName] = ws; 139 var wbout = XLSX.write(wb, { 140 bookType: "xlsx", 141 bookSST: true, 142 type: "binary" 143 }); 144 145 function s2ab(s) { 146 var buf = new ArrayBuffer(s.length); 147 var view = new Uint8Array(buf); 148 for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xff; 149 return buf; 150 } 151 152 saveAs( 153 new Blob([s2ab(wbout)], { type: "application/octet-stream" }), 154 scope.fileName + ".xlsx" 155 ); 156 }; 157 } 158 }; 159});
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.