1// Generated by CoffeeScript 1.12.6 2(function () { 3 var $, addCommas, nl2br; 4 5 if (typeof jQuery === "undefined" || jQuery === null) { 6 return; 7 } 8 9 addCommas = function addCommas(nStr) { 10 var rgx, x, x1, x2; 11 nStr += ''; 12 x = nStr.split('.'); 13 x1 = x[0]; 14 x2 = x.length > 1 ? '.' + x[1] : ''; 15 rgx = /(\d+)(\d{3})/; 16 17 while (rgx.test(x1)) { 18 x1 = x1.replace(rgx, '$1' + ',' + '$2'); 19 } 20 21 return x1 + x2; 22 }; 23 24 nl2br = function nl2br(str) { 25 if (str == null) { 26 return ''; 27 } 28 29 return (str + '').replace(/(\r\n|\n\r|\r|\n)/g, '<br />$1'); 30 }; 31 32 $ = jQuery; 33 $(function () { 34 $('.rate-sheet-product[data-type=arm_loan_rates]').each(function () { 35 $(this).find('.rate-sheet-product-rates-header-name').text('Product Description'); 36 $(this).find('.rate-sheet-product-rates-header-term_years').text('Term (Years)'); 37 $(this).find('.rate-sheet-product-rates-header-initial_rate_percentage').text('Initial Rate (%)'); 38 $(this).find('.rate-sheet-product-rates-header-loan_amount_example').text('Example Loan Amount'); 39 $(this).find('.rate-sheet-product-rates-header-margin_percentage').text('Margin (%)'); 40 $(this).find('.rate-sheet-product-rates-header-annual_percentage_rate').text('Annual Percentage Rate (APR)'); 41 $(this).find('.rate-sheet-product-rates-initial_rate_percentage span').each(function () { 42 var value; 43 44 if ($.isNumeric($(this).html())) { 45 value = Number($(this).html()).toFixed(3); 46 value = addCommas(value); 47 value = value + '%'; 48 $(this).text(value); 49 } 50 }); 51 $(this).find('.rate-sheet-product-rates-margin_percentage span').each(function () { 52 var value; 53 54 if ($.isNumeric($(this).html())) { 55 value = Number($(this).html()).toFixed(3); 56 value = addCommas(value); 57 value = value + '%'; 58 $(this).text(value); 59 } 60 }); 61 $(this).find('.rate-sheet-product-rates-points span').each(function () { 62 var value; 63 64 if ($.isNumeric($(this).html())) { 65 if ($(this).html() == 0) { 66 value = Number($(this).html()); 67 } else { 68 value = Number($(this).html()).toFixed(4); 69 } 70 71 value = addCommas(value); 72 value = value + '%'; 73 74 $(this).text(value); 75 } 76 }); 77 $(this).find('.rate-sheet-product-rates-annual_percentage_rate span').each(function () { 78 var value; 79 80 if ($.isNumeric($(this).html())) { 81 value = Number($(this).html()).toFixed(3); 82 value = addCommas(value); 83 value = value + '%'; 84 $(this).text(value); 85 } 86 }); 87 $(this).find('.rate-sheet-product-rates-loan_amount_example span').each(function () { 88 var value; 89 90 if ($.isNumeric($(this).html())) { 91 value = Number($(this).html()).toFixed(0); 92 value = addCommas(value); 93 value = '$' + value; 94 $(this).text(value); 95 } 96 }); 97 $(this).find('.rate-sheet-product-rates-monthly_payment').each(function () { 98 var monthly_payment = false; 99 100 if ($(this).data('json')) { 101 monthly_payment = $(this).data('json'); 102 } 103 104 if (!monthly_payment) { 105 $(this).html(''); 106 } else { 107 var button = $('<button class="btn btn-default button" type="button">Show Payments</button>'); 108 $(this).html(''); 109 110 if (Array.isArray(monthly_payment)) { 111 var m = monthly_payment; 112 113 console.log('test: ' + monthly_payment); 114 115 if (m[3] != null && m[3] && +m[3] !== 0) { 116 if (m[10] != null && m[10] && +m[10] !== 0) { 117 button.data('payment-streams', encodeURIComponent("\n".concat(m[0] ? '<p>' : '', "\n").concat(m[0], "\n").concat(m[0] ? '</p>' : '', "\n<p>").concat(addCommas(Number(m[8]).toFixed(0)), " payments of\n$").concat(addCommas(Number(m[1]).toFixed(2)), "\nat an interest rate of ").concat(addCommas(Number(m[10]).toFixed(3)), "%</p>\n<p>12 payments of\n$").concat(addCommas(Number(m[3]).toFixed(2)), "\nat an interest rate of ").concat(addCommas(Number(m[11]).toFixed(3)), "%</p>\n<p>").concat(addCommas(Number(m[9]).toFixed(0)), " payments of\n$").concat(addCommas(Number(m[5]).toFixed(2)), "\nat an interest rate of ").concat(addCommas(Number(m[12]).toFixed(3)), "%</p>\n<p>1 payment of\n$").concat(addCommas(Number(m[7]).toFixed(2)), "\nat an interest rate of ").concat(addCommas(Number(m[12]).toFixed(3)), "%</p>"))); 118 } else { 119 button.data('payment-streams', encodeURIComponent("\n".concat(m[0] ? '<p>' : '', "\n").concat(m[0], "\n").concat(m[0] ? '</p>' : '', "\n<p>").concat(addCommas(Number(m[8]).toFixed(0)), " payments of\n$").concat(addCommas(Number(m[1]).toFixed(2)), "</p>\n<p>12 payments of\n$").concat(addCommas(Number(m[3]).toFixed(2)), "</p>\n<p>").concat(addCommas(Number(m[9]).toFixed(0)), " payments of\n$").concat(addCommas(Number(m[5]).toFixed(2)), "</p>\n<p>1 payment of\n$").concat(addCommas(Number(m[7]).toFixed(2)), "</p>"))); 120 } 121 } else { 122 if (m[10] != null && m[10] && +m[10] !== 0) { 123 button.data('payment-streams', encodeURIComponent("\n".concat(m[0] ? '<p>' : '', "\n").concat(m[0], "\n").concat(m[0] ? '</p>' : '', "\n<p>").concat(addCommas(Number(m[8]).toFixed(0)), " payments of\n$").concat(addCommas(Number(m[1]).toFixed(2)), "\nat an interest rate of ").concat(addCommas(Number(m[10]).toFixed(3)), "%</p>\n<p>").concat(addCommas(Number(m[9]).toFixed(0)), " payments of\n$").concat(addCommas(Number(m[5]).toFixed(2)), "\nat an interest rate of ").concat(addCommas(Number(m[12]).toFixed(3)), "%</p>\n<p>1 payment of\n$").concat(addCommas(Number(m[7]).toFixed(2)), "\nat an interest rate of ").concat(addCommas(Number(m[12]).toFixed(3)), "%</p>"))); 124 } else { 125 button.data('payment-streams', encodeURIComponent("\n".concat(m[0] ? '<p>' : '', "\n").concat(m[0], "\n").concat(m[0] ? '</p>' : '', "\n<p>").concat(addCommas(Number(m[8]).toFixed(0)), " payments of\n$").concat(addCommas(Number(m[1]).toFixed(2)), "</p>\n<p>").concat(addCommas(Number(m[9]).toFixed(0)), " payments of\n$").concat(addCommas(Number(m[5]).toFixed(2)), "</p>\n<p>1 payment of\n$").concat(addCommas(Number(m[7]).toFixed(2)), "</p>"))); 126 } 127 } 128 } else { 129 button.data('payment-streams', encodeURIComponent("\n<p>".concat(nl2br("".concat(monthly_payment)), "</p>"))); 130 } 131 132 $(this).append(button); 133 button.on('click', function () { 134 bootbox.dialog({ 135 title: 'Payment Streams', 136 message: decodeURIComponent(button.data('payment-streams')), 137 buttons: { 138 cancel: { 139 label: 'Close', 140 className: 'btn-default' 141 } 142 } 143 }); 144 }); 145 } 146 }); 147 }); 148 $('.rate-sheet-product[data-type=consumer_loan_rates]').each(function () { 149 $(this).find('.rate-sheet-product-rates-header-name').text('Product Name'); 150 $(this).find('.rate-sheet-product-rates-header-maximum_term_months').text('Maximum Term (Months)'); 151 $(this).find('.rate-sheet-product-rates-header-annual_percentage_rate').text('Annual Percentage Rate (APR)'); 152 $(this).find('.rate-sheet-product-rates-loan_amount_example').each(function () { 153 var value; 154 155 if ($.isNumeric($(this).html())) { 156 value = Number($(this).html()).toFixed(0); 157 value = addCommas(value); 158 value = '$' + value; 159 $(this).text(value); 160 } 161 }); 162 $(this).find('.rate-sheet-product-rates-rate span').each(function () { 163 var value; 164 165 if ($.isNumeric($(this).html())) { 166 value = Number($(this).html()).toFixed(2); 167 value = addCommas(value); 168 value = value + '%'; 169 $(this).text(value); 170 } 171 }); 172 $(this).find('.rate-sheet-product-rates-annual_percentage_rate span').each(function () { 173 var value; 174 175 if ($.isNumeric($(this).html())) { 176 value = Number($(this).html()).toFixed(2); 177 value = addCommas(value); 178 value = value + '%'; 179 $(this).text(value); 180 } 181 }); 182 $(this).find('.rate-sheet-product-rates-monthly_payment span').each(function () { 183 var value; 184 185 if ($.isNumeric($(this).html())) { 186 value = Number($(this).html()).toFixed(2); 187 value = addCommas(value); 188 value = '$' + value; 189 $(this).text(value); 190 } 191 }); 192 }); 193 $('.rate-sheet-product[data-type=fixed_loan_rates]').each(function () { 194 $(this).find('.rate-sheet-product-rates-header-name').text('Product Description'); 195 $(this).find('.rate-sheet-product-rates-header-term_years').text('Term (Years)'); 196 $(this).find('.rate-sheet-product-rates-header-loan_to_value').text('Loan-to-Value'); 197 $(this).find('.rate-sheet-product-rates-header-initial_rate').text('Interest Rate'); 198 $(this).find('.rate-sheet-product-rates-header-apr').text('Annual Percentage Rate (APR)'); 199 $(this).find('.rate-sheet-product-rates-monthly_payment span').each(function () { 200 var value; 201 202 if ($.isNumeric($(this).html())) { 203 value = Number($(this).html()).toFixed(0); 204 value = addCommas(value); 205 value = '$' + value; 206 $(this).text(value); 207 } 208 }); 209 $(this).find('.rate-sheet-product-rates-example_loan_amount span').each(function () { 210 var value; 211 212 if ($.isNumeric($(this).html())) { 213 value = Number($(this).html()).toFixed(0); 214 value = addCommas(value); 215 value = '$' + value; 216 $(this).text(value); 217 } 218 }); 219 $(this).find('.rate-sheet-product-rates-initial_rate span').each(function () { 220 var value; 221 222 if ($.isNumeric($(this).html())) { 223 value = Number($(this).html()).toFixed(3); 224 value = addCommas(value); 225 value = value + '%'; 226 $(this).text(value); 227 } 228 }); 229 $(this).find('.rate-sheet-product-rates-points span').each(function () { 230 var value; 231 232 if ($.isNumeric($(this).html())) { 233 if ($(this).html() == 0) { 234 value = Number($(this).html()); 235 } else { 236 value = Number($(this).html()).toFixed(4); 237 } 238 239 value = addCommas(value); 240 value = value + '%'; 241 242 $(this).text(value); 243 } 244 }); 245 $(this).find('.rate-sheet-product-rates-apr span').each(function () { 246 var value; 247 248 if ($.isNumeric($(this).html())) { 249 value = Number($(this).html()).toFixed(3); 250 value = addCommas(value); 251 value = value + '%'; 252 $(this).text(value); 253 } 254 }); 255 $(this).find('.rate-sheet-product-rates-total_paid_at_end_of_loan span').each(function () { 256 var value; 257 258 if ($.isNumeric($(this).html())) { 259 value = Number($(this).html()).toFixed(2); 260 value = addCommas(value); 261 value = '$' + value; 262 $(this).text(value); 263 } 264 }); 265 266 if (+$(this).data('id') === 38) { 267 $(this).find('.rate-sheet-product-rates-header-total_paid_at_end_of_loan').hide(); 268 $(this).find('.rate-sheet-product-rates-total_paid_at_end_of_loan').hide(); 269 } 270 }); 271 $('.rate-sheet-product[data-type=deposit_rates]').each(function () { 272 $(this).find('.rate-sheet-product-rates-header-name').text('Product Name'); 273 $(this).find('.rate-sheet-product-rates-header-annual_percentage_yield_apy').text('Annual Percentage Yield (APY)'); 274 $(this).find('.rate-sheet-product-rates-minimum_balance_to_earn_stated_apy span').each(function () { 275 var value; 276 277 if ($.isNumeric($(this).html())) { 278 value = Number($(this).html()).toFixed(2); 279 value = addCommas(value); 280 value = '$' + value; 281 $(this).text(value); 282 } 283 }); 284 $(this).find('.rate-sheet-product-rates-interest_rate span').each(function () { 285 var value; 286 287 if ($.isNumeric($(this).html())) { 288 value = Number($(this).html()).toFixed(2); 289 value = addCommas(value); 290 value = value + '%'; 291 $(this).text(value); 292 } 293 }); 294 $(this).find('.rate-sheet-product-rates-annual_percentage_yield_apy span').each(function () { 295 var value; 296 297 if ($.isNumeric($(this).html())) { 298 value = Number($(this).html()).toFixed(2); 299 value = addCommas(value); 300 value = value + '%'; 301 $(this).text(value); 302 } 303 }); 304 }); 305 });
306}).call(this);
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.