1function initSelectInvoicePayment() { 2 /* prevent payment if no invoice selected */ 3 if ( window.location.href.indexOf('section=payment') > -1 ) { 4 console.log('payments page'); 5 $('.formButtons .submitButton').removeAttr('onclick'); 6 $('.formButtons .submitButton').unbind('click'); 7 $('.formButtons .submitButton').on('click', function() { 8 if ( $('#invoice_id').val() != '') { 9 SaveChanges(false); 10 return false; 11 } else { 12 alert('Please Select an Invoice'); 13 return false; 14 } 15 16 }); 17 } 18} 19 20function checkSideMenu() { 21 if ( $('#sub_menu ul a').length > 0 ) { $('#sub_menu').show(); } 22} 23 24function createMobileMenu() { 25 26 $('#main_menu>ul').clone().appendTo('#mobile_menu'); 27 $('#top_menu a').clone().appendTo('#mobile_menu'); 28 29 // Function to Dropdown Mobile Menu Items 30 $('#mobile_menu li a').each(function(){ 31 if ( $(this).siblings('ul').length > 0 ) { 32 var targetSubmenu = $(this).siblings('ul'); 33 $(this).parent('li').clone().prependTo(targetSubmenu); 34 $(this).click(function(event) { 35 event.preventDefault(); 36 if ( targetSubmenu.is(':hidden') ) { targetSubmenu.slideDown().addClass('mmexpanded') } 37 else { targetSubmenu.slideUp().removeClass('mmexpanded'); } 38 }); 39 } 40 }); 41 42 // Function to Display Mobile Menu 43 $('#menu_toggle span.fa-bars').click(function(){ 44 $('#mobile_menu').slideToggle(400); 45 }); 46 47} 48 49 function html2pdfv2() { 50 var doc = new jsPDF(); 51 var elementHandler = { 52 '#bypassme': function (element, renderer) { 53 return true; 54 } 55 }; 56 var source = $('body')[0]; 57 doc.fromHTML( 58 source, 59 15, 60 15, 61 { 62 'width': 620,'elementHandlers': elementHandler 63 }); 64 65 doc.output("dataurlnewwindow"); 66 //doc.save('download.pdf'); 67 } 68 69 function html2pdf() { 70 $('#bypassme').css('display','none') 71 var pdf = new jsPDF('p', 'pt', 'letter'); 72 // source can be HTML-formatted string, or a reference 73 // to an actual DOM element from which the text will be scraped. 74 source = $('#pdfArea')[0]; 75 76 // we support special element handlers. Register them with jQuery-style 77 // ID selector for either ID or node name. ("#iAmID", "div", "span" etc.) 78 // There is no support for any other type of selectors 79 // (class, of compound) at this time. 80 specialElementHandlers = { 81 // element with id of "bypass" - jQuery style selector 82 '#bypassme': function (element, renderer) { 83 // true = "handled elsewhere, bypass text extraction" 84 return true 85 } 86 }; 87 margins = { 88 top: 20, 89 bottom: 20, 90 left: 20, 91 width: 960 92 }; 93 // all coords and widths are in jsPDF instance's declared units 94 // 'inches' in this case 95 pdf.addHTML( 96 source, // HTML string or DOM elem ref. 97 margins.left, // x coord 98 margins.top, { // y coord 99 'width': margins.width, // max width of content on PDF 100 'elementHandlers': specialElementHandlers 101 }, 102 103 function (dispose) { 104 // dispose: object with X, Y of the last line add to the PDF 105 // this allow the insertion of new lines after html 106 pdf.save('download2.pdf'); 107 }, margins 108 ); 109 } 110 111 112function cleanAntispam() { 113 $('#form_AskanExpert1 .simpleAntiSpam').hide(); 114 $('#form_AskanExpert1 input[type="submit"]').hide().before('<div id="nextlink">Next <span class="fa fa-arrow-circle-right"></span></div><div id="prevlink" style="display: none;"><span class="fa fa-arrow-circle-left"></span> Back</div>'); 115 116 $('#nextlink').click(function(){ 117 $('#form_AskanExpert1 .message, #form_AskanExpert1 .right_field, #form_AskanExpert1 .left_field, #form_AskanExpert1 .formtext, #nextlink').hide(); $('#form_AskanExpert1 .simpleAntiSpam, #prevlink, #form_AskanExpert1 input[type="submit"]').fadeIn(300); 118 }); 119 120 $('#prevlink').click(function(){ 121 $('#form_AskanExpert1 .simpleAntiSpam, #prevlink, #form_AskanExpert1 input[type="submit"]').hide(); $('#form_AskanExpert1 .message, #form_AskanExpert1 .right_field, #form_AskanExpert1 .left_field, #form_AskanExpert1 .formtext, #nextlink').fadeIn(300); 122 }); 123 124} 125 126function eventsLoginPopup(force) { 127// if(force || (!$.cookie('USERAUTH') && !$.cookie('seenloginpopup'))) { 128 $.magnificPopup.open({ 129 items: {src:'index.php?src=membership&srctype=membership_login_ajax&direct=y'}, 130 type: 'ajax', 131 closeOnBgClick: false, 132 showCloseBtn: false, 133 focus: 'input[name=username]' 134 }); 135// } 136} 137 138function eventRegistrationPopup() { 139 $('a.ajaxPopup').magnificPopup({ 140 type: 'ajax', 141 closeOnBgClick: false 142 }); 143} 144 145 146function myAccountFieldEditor(event, field, openURL) { 147 // --- Function for Opening Popups on the MyAccount Page to Edit Specific Fields | See Matthew Giebeig for Questions 148 // --- Ajaxes in the form specified in the openURL parameter, and Does specific edits Based on What is input in the Field Parameter 149 event.preventDefault(); 150 $.ajax({ 151 url: openURL, 152 cache: false, 153 success: function(response) { 154 var ajaxHTML = $(response).find('#content form'); 155 $('body').prepend('<div id="popup_overlay" class="inactive"></div><div id="popup_body" class="inactive"><span id="popup_close" class="fa fa-times-circle"></span><h2 id="popup_title">Change ' + field +'</h2><div id="popup_content"></div><div id="popup_submit">Confirm and Submit</div><div id="popup_cancel">Cancel</div></div></div></div>') 156 $('#popup_content').append(ajaxHTML); 157 158 // Do Some Specific Form Doctoring Based on the Field Being Edited 159 switch(field){ 160 case 'Name': 161 $('#popup_content form tr, .formButtons').hide(); 162 $('.tr_contact_fname, .tr_contact_lname').show(); 163 break; 164 165 case 'Phone':
166 $('#popup_title').text('Edit Phone Number').after('<h4 style="margin:0px 0px 20px; padding:0px; text-align:center;">Use Format: 1-234-567-8910</h4>'); 167 $('#popup_content form tr, .formButtons').hide(); 168 $('.tr_contact_phone').show(); 169 break; 170 171 case 'Password': 172 $('.formButtons').hide(); 173 break; 174 175 case 'Email': 176 $('#popup_title').text('Manage Email Subscriptions'); 177 $('.formButtons').hide(); 178 $('#blacklist_input').change(function(){ 179 if($(this).is(":checked")){ 180 $('.category_input').each(function(i, el){ 181 $(el).attr('disabled', true); 182 }); 183 } else { 184 $('.category_input').each(function(i, el){ 185 $(el).attr('disabled', false); 186 }); 187 } 188 }).trigger('change'); 189 break; 190 191 default: 192 console.log('Nothing to Open'); 193 } 194 $('#popup_close, #popup_cancel, #popup_overlay').click(function(){ $('#popup_overlay, #popup_body').remove(); }); // Close Popup Function 195 $('#popup_overlay, #popup_body').removeClass('inactive'); // Animate in the Popup ( CSS Transitions ) 196 197 // Submit form and reload when successfull 198 $('#popup_submit').click(function(event) { 199 $(this).html('Saving <span class="fa fa-spin fa-refresh"></span>').addClass('saving'); 200 $.ajax({ 201 type: "POST", 202 url: "index.php", 203 data: $('#popup_content form').serialize(), 204 success: function() { 205 location.reload(); 206 } 207 }); 208 }); 209 } 210 }); 211} 212 213// Calculate Goal Amount on Groups Breakdown Page 214function getAmtToGoal() { 215 var goalAmount = $(".goal").data("goal-amount"); 216 var totalInvoicved = $(".goal").data("total-amount-invoiced"); 217 var untilGoal = parseFloat(goalAmount.replace( /[^0-9\.]+/g,"")) - parseFloat(totalInvoicved.replace( /[^0-9\.]+/g,"")); 218 $("#goalReached").text(untilGoal.toLocaleString('en-US', { style: 'currency', currency: 'USD' })); 219} 220 221// Groups Sales Breakdown Per Sales Person Table 222function totalSalesBreakdowns() { 223 $("#js_group_sales_table tr").each(function () { 224 var salesPerson = $(this).data("sales-person"); 225 226 // Trades 227 var $tradeRows = $("tr[data-information='"+ salesPerson +"-Trade']"); 228 var tradeTotal = 0; 229 $tradeRows.each(function() { 230 tradeTotal += parseFloat($(this).find(".invoice_amount").text()); 231 }); 232 $(this).find("span.total_trades_js").text(tradeTotal); 233 234 // Cash 235 var $cashRows = $("tr[data-information='"+ salesPerson +"-Cash']"); 236 var cashTotal = 0; 237 $cashRows.each(function() { 238 cashTotal += parseFloat($(this).find(".invoice_amount").text()); 239 }); 240 $(this).find("span.total_cash_js").text(cashTotal); 241 242 }); 243 $("#js_group_sales_table").appendTo("#total_sales_per_person"); 244 // Format Total Cash and Total Sales to USD Currency 245 $("td > span.total_cash_js").each(function() { $(this).html(parseFloat($(this).text()).toLocaleString('en-US', {style: 'currency', currency: 'USD'})); }); 246 $("td > span.total_trades_js").each(function() { $(this).html(parseFloat($(this).text()).toLocaleString('en-US', {style: 'currency', currency: 'USD'})); }); 247 $("td.invoice_amount").each(function() { $(this).html(parseFloat($(this).text()).toLocaleString('en-US', {style: 'currency', currency: 'USD'})); }); 248} 249// Format Goal Amount on Groups Lister 250function formatGoalAmount() { 251 $("td.goal_amount").each(function() { $(this).html(parseFloat($(this).text()).toLocaleStr
251ing('en-US', {style: 'currency', currency: 'USD'})); }); 252} 253 254$(document).ready(function(){ 255 256 initSelectInvoicePayment(); 257 258 $('#createPDF').click(function() { html2pdf(); $('#restoreBuilder').css('display','inline-block'); }); 259 $('#changeTitle').click(function() { $('#reportTitle').html( $('#newTitle').val() ); }); 260 $('#restoreBuilder').click(function() { $('#bypassme').css('display','block'); }); 261 262 // unfortunate workaround needed to handle coupons for specific events while using shopping cart 263 if($('.ticketTypeTable tbody tr td.ticketTypeDesc:contains("Discounted")').length || $('.ticketTypeTable tbody tr td.ticketTypeDesc:contains("Complimentary")').length || $('.ticketTypeTable tbody tr td.ticketTypeDesc:contains("Save 25")').length ){ 264 $('.ticketTypeTable tbody tr td.ticketTypeDesc:contains("Discounted"),.ticketTypeTable tbody tr td.ticketTypeDesc:contains("Complimentary"),.ticketTypeTable tbody tr td.ticketTypeDesc:contains("Save 25"), .ticketTypeTable tbody tr td.ticketTypeDesc:contains("Summit75"), .ticketTypeTable tbody tr td.ticketTypeDesc:contains("Member75")').parent().hide(); 265 if($('input.couponcode').length){ 266 //dialogue already created by other coupon type 267 }else{ 268 $('.ticketTypeTable').before('<tr id="couponbox"><td>Coupon Code</td><td><input class="couponcode" name="coupon" /></td></tr>'); 269 } 270 271 if(Freedom.getQueryParameters().coupon) { 272 var coupon = decodeURIComponent(Freedom.getQueryParameters().coupon); 273 $('input[name=coupon]').val(coupon); 274 applyCoupon(); 275 } 276 277 $('input.couponcode').keyup(applyCoupon); 278 279 function applyCoupon(){ 280 var cc = $('input.couponcode').val(); 281 if((cc == 'partner25') || (cc == "partner25")){ 282 $('.ticketTypeTable tbody tr td.ticketTypeDesc:contains("Discounted")').parent().show(); 283 $('.ticketTypeTable tbody tr td.ticketTypeDesc').not(':contains("Discounted")').not(':contains("Complimentary")').parent().hide(); 284 if($('.codeapplied').length){}else{$(this).after('<span class="codeapplied"> Discount Applied!</span>');} 285 $('.ticketTypePrice').css('font-weight','bold'); 286 } 287 else if(cc == 'HECfree18'){ 288 $('.ticketTypeTable tbody tr td.ticketTypeDesc:contains("Complimentary")').parent().show(); 289 $('.ticketTypeTable tbody tr td.ticketTypeDesc').not(':contains("Complimentary")').not(':contains("Discounted")').parent().hide(); 290 if($('.codeapplied').length){}else{$(this).after('<span class="codeapplied"> Discount Applied!</span>');} 291 $('.ticketTypePrice').css('font-weight','bold'); 292 } 293 else if(cc == 'SUMMITFLASH'){ 294 $('.ticketTypeTable tbody tr td.ticketTypeDesc:contains("Fifty")').parent().show(); 295 $('.ticketTypeTable tbody tr td.ticketTypeDesc').not(':contains("Fifty")').not(':contains("Complimentary")').parent().hide(); 296 if($('.codeapplied').length){}else{$(this).after('<span class="codeapplied"> Discount Applied!</span>');} 297 $('.ticketTypePrice').css('font-weight','bold'); 298 } 299 else if(cc == 'tulsa25'){ 300 $('.ticketTypeTable tbody tr td.ticketTypeDesc:contains("Save 25")').parent().show(); 301 $('.ticketTypeTable tbody tr td.ticketTypeDesc').not(':contains("Complimentary")').not(':contains("Save 25")').parent().hide(); 302 if($('.codeapplied').length){}else{$(this).after('<span class="codeapplied"> Discount Applied!</span>');} 303 $('.ticketTypePrice').css('font-weight','bold'); 304 } 305 else if(cc == 'member25'){ 306 $('.ticketTypeTable tbody tr td.ticketTypeDesc:contains("Reduced")').parent().show(); 307 $('.ticketTypeTable tbody tr td.ticketTypeDesc').not(':contains("Reduced")').not(':contains("Complimentary")').parent().hide(); 308 if($('.codeapplied').length){}else{$(this).after('<span class="codeapplied"> Discount Applied!</span>');} 309 $('.ticketTypePrice').css('font-weight','bold'); 310 } 311 else if(cc == 'summit75'){ 312 $('.ticketTypeTable tbody tr td.ticketTypeDesc:contains("Summit75")').parent().show(); 313 $('.ticketTypeTable tbody tr td.ticketTypeDesc').not(':contains("Summit75")').not(':contains("Complimentary")').parent().hide(); 314 if($('.codeapplied').length){}else{$(this).after('<span class="codeapplied"> Discount Applied!</span>');} 315 $('.ticketTypePrice').css('font-weight','bold'); 316 } 317 else if(cc == 'member75'){ 318 $('.ticketTypeTable tbody tr td.ticketTypeDesc:contains("Member75")').parent().show(); 319 $('.ticketTypeTable tbody tr td.ticketTypeDesc').not(':contains("Member75")').not(':contains("Complimentary")').parent().hide(); 320 if($('.codeapplied').length){}else{$(this).after('<span class="codeapplied"> Discount Applied!</span>');} 321 $('.ticketTypePrice').css('font-weight','bold'); 322 } 323 else { 324 $('.ticketTypeTable tbody tr td.ticketTypeDesc:contains("Discounted"),.ticketTypeTable tbody tr td.ticketTypeDesc:contains("Complimentary"),.ticketTypeTable tbody tr td.ticketTypeDesc:contains("Save 25"),.ticketTypeTable tbody tr td.ticketTypeDesc:contains("Reduced"), .ticketTypeTable tbody tr td.ticketTypeDesc:contains("Summit75"), .ticketTypeTable tbody tr td.ticketTypeDesc:contains("Member75")').parent().hide(); 325 $('.ticketTypeTable tbody tr td.ticketTypeDesc').not(':contains("Complimentary")').not(':contains("Discounted")').not(':contains("Save 25")').not(':contains("Reduced")').not(':contains("Summit75")').not(':contains("Member75")').parent().show(); 326 $('.codeapplied').remove(); 327 $('.ticketTypePrice').css('font-weight','normal'); 328 } 329 } 330 331 } 332 333 $('a.zoombox, .zoombox a').zoombox(); 334 335 $('.slice20').each(function(){ 336 var textSlice = $(this).text().replace(/\u00a0/g, '').split(' ').slice(0, 20); 337 $(this).text( textSlice.join(' ') + '...'); 338 }); 339 340 341 // Fixed Menu Script 342 $(window).scroll(function(){ 343 if ( $(window).scrollTop() > 127) { $('#main_menu, #header').addClass('fixed'); $('#back_to_top').addClass('scrolled');} 344 if ( $(window).scrollTop() < 126) { $('#main_menu, #header').removeClass('fixed'); $('#back_to_top').removeClass('scrolled');} 345 }); 346 347 348 // Back to Top Script 349 $('#back_to_top').click(function(){ 350 $('body').animate({scrollTop: 0}, 1000) 351 }); 352 353 $('#homepage_switcher .toggle').last().addClass('last'); 354 $('#homepage_switcher .toggle').click(function(){ 355 $('#homepage_switcher .toggle').removeClass('active'); 356 $('#homepage_switcher .content_tab').hide(); 357 $(this).addClass('active'); 358 $('#homepage_switcher #tab_' + $(this).attr('id').split("_").pop() ).show(); 359 360 361 }); 362 363 // for member directory search of business categories 364 // if($('#catcodeSearch').length){ 365 $('#businessCats').load('index.php?src=reports&srctype=detail&ref=Business_Categories_List select',function(){ 366 $('#catcodeSearch').click(function(e){ 367 e.preventDefault(); 368 var catcode = encodeURIComponent($('#form_membership_search_category select').val()); 369 window.location = 'https://tulsachamber.com/index.php?src=membership&hurl=n&srctype=lister&query=sba_busc.misc0.eq.'+catcode+'.or.sba_busc.misc1.eq.'+catcode+'.or.sba_busc.misc2.eq.'+catcode+'.or.sba_busc.misc3.eq.'+catcode+'.or.sba_busc.misc4.eq.'+catcode+'.or.sba_busc.misc5.eq.'+catcode+'.or.sba_busc.misc6.eq.'+catcode+'.or.sba_busc.misc7.eq.'+catcode+'.or.sba_busc.misc8.eq.'+catcode+'.or.sba_busc.misc9.eq.'+catcode+'.or.sba_busc.extra_busc10.eq.'+catcode+'.or.sba_busc.extra_busc11.eq.'+catcode+'.or.sba_busc.extra_busc12.eq.'+catcode+'.or.sba_busc.extra_busc13.eq.'+catcode+'.or.sba_busc.extra_busc14.eq.'+catcode;
370 }); 371 // set the list option:selected to the currently displaying filter 372 $('#form_membership_search_category select option[value="'+decodeURI(window.location.href.split('.').pop())+'"]').prop('selected','selected'); 373 }); 374 // } 375 376 // Function to Expand Search Box 377 $('#mobile_search_button').click(function(){ 378 if ( $('#mobile_site_search #search_box_form').is(':visible') ) { 379 $('#mobile_search_button').removeClass('active_search'); 380 $('#mobile_site_search').removeClass('active_search'); 381 $('#mobile_site_search #search_box_form').fadeOut(200); 382 } 383 else { 384 $('#mobile_search_button').addClass('active_search'); 385 $('#mobile_site_search #search_box_form').fadeIn(400, function() { $('#searchBoxInput').focus(); $('#mobile_site_search').addClass('active_search'); } ); 386 387 } 388 }); 389 390 $('#social_switcher .social_toggle').last().addClass('last'); 391 $('#social_switcher .social_toggle').click(function(){ 392 $('#social_switcher .social_toggle').removeClass('active'); 393 $('#social_switcher .social_content_tab').hide(); 394 $(this).addClass('active'); 395 $('#social_switcher #social_tab_' + $(this).attr('id').split("_").pop() ).show(); 396 397 398 }); 399 400 // For cleaning up Myaccount Form Fields 401 $('.myaccountLister .formButtons a:contains("Cancel")').addClass('cancel'); 402 403 //////////////////////////////////////////////////////////////////////////// 404 // Ajax Mini-Cal with Hover Details 405 // This will load Freedom's minical via ajax into the selector of your choosing 406 // and creates a css tooltip containing that day's event info 407 // Brian Stich (2013) 408 //////////////////////////////////////////////////////////////////////////// 409 var thetarget = $('#minical-box'); // a div into which you will load the calendar 410 thetarget.load( 'index.php?src=events&srctype=events_calendar&m=&y=&direct=y', ajxcal); 411 412 function ajxcal() { 413 $('.calPrev a, .calNext a').click(function (e) { 414 thetarget.load($(this).attr('href'), ajxcal); 415 e.preventDefault(); 416 }); 417 $('.calGrid a').parent().addClass('haslink').hover(function () { 418 var thedayseventspath = $(this).find('a').attr('href'); 419 $(this).css('position', 'relative').append('<div class="thedaysevents" style="display:none" />'); 420 $('.thedaysevents').load(thedayseventspath+' .itemList', function () { 421 var thedayof = $(this).find('h2.eventDateHeading').text(); 422 $(this).find('.date, h2.eventDateHeading, .filter').remove(); 423 $(this).find('h1').text('Events - ' + thedayof); 424 $(this).fadeIn(); 425 }); 426 }); 427 $('.calGrid a').parent().mouseleave(function () { 428 $('.thedaysevents').remove(); 429 }); 430 } 431 432 //////////////////////////////////////////////////////////////////////////// 433 // end ajax mini-calendar 434 //////////////////////////////////////////////////////////////////////////// 435 436 437 438});
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.